The Document Object Model (DOM), Part 5: A Final Word
The Document Object Model (DOM), Part 5 (8)
A Final Word
In this column we covered in depth the DOM's different methods for creating nodes and assembling DOM trees. We showed you how to create HTML tag nodes as well as text nodes, and how to clone them. We demonstrated how to assemble a table with three different methods. We assembled the tree from top to bottom with the appendChild
method, which appends a child to an existing list of children. We built the tree bottom up with the applyElement
method, which establishes a father-son relationship after the target father is stripped from his existing children and father. The insertBefore
method works exactly like the appendChild
. In this column you learned:
- How to create a new HTML tag node
- How to create a new text node
- How to clone an existing node
- How to append a child to a father
- How to nominate a father to a child
- How to connect a child to a father
Produced by Yehuda Shiran and Tomer Shiran
Created: July 19, 1999
Revised: July 19, 1999
URL: https://www.webreference.com/js/column44/final.html