Removing and Replacing Elements

The DOM API provides a few operations that allow you to remove existing elements or replace a node of the document tree with another one. In this lesson, you will learn how to use these operations.

Earlier you learned that Firefox does not support the insertAdjacent...() operations, which are not the part of the DOM API standard, although all other major browsers support it.

To wrap all links with square brackets, you can find a general solution instead of the one demonstrated in Listing 6-9, which uses the script in Listing 6-10.

Listing 6-10: Browser independent way of fixing issues with Listing 6-9

Get hands-on with 1200+ tech skills courses.