Chapter 12: Objects and the DOM

Return to Chapter 12


To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Deleting Nodes

See it run: Deleting Nodes

Script 12.3

This JavaScript adds a link, rather than a button, to delete a text node.

Script 12.4

Using this JavaScript, the user can both add and delete text.