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: Using insertAdjacentText(), which uses the script in the Listing below.

Listing: Browser independent way of fixing issues with the previous Listing

Get hands-on with 1400+ tech skills courses.