8.9 Document Object Model
Whew! We’ve finally finished examining the Hello web page code. The examination process required getting down in the weeds and learning about objects. Now let’s step back and look at a big-picture issue related to objects. Let’s examine how a web page’s objects are organized.
The Document Object Model, which is normally referred to as the DOM, models all of the parts of a web page document as nodes in a node tree. A node tree is similar to a directory tree, except instead of showing directories that include other directories (and files), it shows web page elements that include other elements (and text and attributes). Each node represents either (1) an element, (2) a text item that appears between an element’s start ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access