O'Reilly logo

JavaScript: Visual QuickStart Guide, Eighth Edition by Dori Smith, Tom Negrino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10. Objects and the DOM

In This Chapter

About Node Manipulation 242

Adding Nodes 244

Deleting Nodes 246

Deleting Specific Nodes 248

Inserting Nodes 251

Replacing Nodes 254

Writing Code with Object Literals 257

Node manipulation is the W3C-recommended way for standards-compliant browsers to support Web pages that act more like applications than the standard, static pages that you’re used to. For instance, you can have pages that change based on entries the user makes, without hitting the server, and you can update pages under script control. Although you can use techniques like innerHTML, as we’ve done elsewhere in this book, here we show the officially supported approach. While this can also be done on the server side, it’s only with JavaScript ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required