HTML and CSS Reference
EXPLANATION ( CONTINUED )
A reference to a new div is returned.
The cloned table is appended to the div just below the original table (see Figure 15.26).
This is the div container for the cloned table.
Figure 15.26 Cloning a table with a unique id .
If you want to dynamically remove a post from a blog or an ingredient from an online
recipe, it can be done with the DOM. To delete an element or node from the DOM tree,
we use the removeChild() method. This method must be called from the parent node
because you will be removing a child. It takes a reference to the child it will remove as
its only argument. The following examples demonstrate how to dynamically remove
and its contents; the second example, Example 15.16, removes paragraphs.