The Beginnings of DOM

The Pandora's box of Document Object Models was opened by Netscape Navigator 2, the first browser to implement a DOM. Just so we're clear, let's look at precisely what a DOM is and what it's good for. DOM stands for Document Object Model, which means that browsers view Web pages as neatly ordered hierarchies. The only reason to have a DOM is to allowprogrammers to refer to elements within the Web page. At the very top of the hierarchy is the window object, which represents the browser window. After the window object, there is the document object, and on down through forms, form elements, images, links, and such. Actually, the very first DOM didn't even include images. The first DOM looked a lot like Figure 9-1.

Figure 9-1. ...

Get Advanced JavaScript™: Insights and Innovative Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.