XML DOMLesson 40Free preview
DOM Remove Nodes
This lesson is part of XML · All levels
Summary
The node is removed from the tree by removing its parent's child, or by the remove() method on the node itself on the modern DOM. The deleted result nodes can still be stored in a variable for reuse, but no longer appear in the document. Removing the element also removes the entire subtree underneath it.
Key points
- RemoveChild is called to the parent and returns the deleted node
- It makes it easier to remove on modern DOMs.
- Subtree and offspring are removed from the tree
- The resulting deleted node can still be saved for reuse.
- Deletion updates the document's appearance directly
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.