Easy Tutorial
❮ Dom Met Element Setattributenode Met Cdata Substringdata ❯

XML DOM removeChild() Method



Definition and Usage

The removeChild() method removes a child node.

If successful, the function returns the removed node; if it fails, it returns NULL.

Syntax

Parameter Description
node Required. Specifies the child node to be removed.

Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc and removes the child node of the first <book> element:

Example

Output:


Try It Demos

removeChild() - Remove the last child node from the node list


❮ Dom Met Element Setattributenode Met Cdata Substringdata ❯