XML DOM removeChild() Method
Complete Node Object Reference
Definition and Usage
The removeChild() method removes a child node.
This function returns the removed node on success, or NULL on failure.
Syntax
|
elementNode.removeChild(node) |
| Parameter |
Description |
| node |
Required. Specifies the child node to remove |
Example
The following code fragment loads "books.xml"
into xmlDoc using
loadXMLDoc() and removes a child node in the first <book> node:
Example
xmlDoc=loadXMLDoc("books.xml");
y=xmlDoc.getElementsByTagName("book")[0];
x=xmlDoc.documentElement.removeChild(y);
document.write("Removed node: " + x.nodeName);
|
Output:
Try it yourself »
|
Complete Node Object Reference

The Altova MissionKit is an integrated suite of tools ideal for:
- XML development
- Web & Web services development
- Data mapping & integration
- Rendering & publishing XML & database data
- XBRL validation, taxonomy editing, transformation & rendering
The MissionKit for XML Developers includes XMLSpy® - the industry-leading XML editor; MapForce® - a
graphical data mapping, conversion, and integration tool; StyleVision® - a visual XSLT stylesheet designer;
DiffDog® - an XML-aware diff/merge tool; and 2 additional tools.
Try all 6 products free for 30 days!
Download a fully-functional free trial
|
|
|
|