Chapter 10. The Document Object Model

After reading this chapter, you'll be able to

  • Use the Document Object Model to retrieve elements from a document.

  • Create new elements in a document.

  • Make changes to elements in a document.

  • Remove elements from a document.

The Document Object Model Defined

The Document Object Model (DOM) provides a way to access and alter the contents of Hypertext Markup Language (HTML) documents. The DOM is a standard defined by the World Wide Web Consortium (W3C) and is implemented in various forms and with varying degrees of success by most Internet browsers.

Like many other standards, especially those related to Web programming, the DOM has evolved over the years. It has three specifications, known as levels in DOM-speak, with ...

Get JavaScript Step by Step now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.