Element Object
The replaceChild() method replaces a child node with another.
This function returns the replaced node on success, or NULL on failure.
| Parameter | Description |
|---|---|
| new_node | Required. Specifies the new node |
| old_node | Required. Specifies the child node to replace |
The following code fragment loads "books.xml" into xmlDoc using loadXMLDoc() and replaces the first <book> element:
Element Object
Your message has been sent to W3Schools.