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.

Replacing Nodes

See it run: Replacing Nodes

Script 12.9

This HTML adds the Replace node radio button to previous examples.

Script 12.10

This JavaScript gives users the complete range of node manipulation. They can add, delete, and replace any text on the page.