O'Reilly logo

JavaScript Quick Syntax Reference by Mikael Olsson

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

CHAPTER 10

image

Document Object Model

The Document Object Model or DOM is a programming interface that describes all elements of a web document and how they are related to each other. It is through this interface that JavaScript code can interact with the web document.

DOM Nodes

In the DOM model, the content of the web document is represented in a tree-like structure consisting of nodes. By knowing how these nodes are organized, it becomes possible to change any part of the document dynamically. Consider the following HTML markup.

<p>My paragraph</p>

This markup creates two nodes in the DOM tree: an element node and a text node. Element nodes can have ...

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