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.

Inserting Nodes

See it run: Inserting Nodes

Script 12.7

This HTML adds another radio button to allow a third option -- inserting text before another paragraph.

Script 12.8

With this JavaScript, the user can now add text anywhere on the page.