Chapter 12: Objects and the DOM


Adding Nodes
Deleting Nodes
Deleting Specific Nodes
Inserting Nodes
Replacing Nodes

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 Specific Nodes

See it run: Deleting Specific Nodes

Script 12.5

This HTML adds radio buttons, which offers your visitors the choice of adding or deleting text.

Script 12.6

This JavaScript allows users to choose which paragraph they want to delete.