Chapter 10. DOM: The Document Object Model

One of the most significant changes associated with JavaScript was the W3C’s work in conjunction with all browser vendors (including Netscape and Microsoft) to create a consistent underlying object model. All major browsers agreed to support this model, eliminating most, if not all, cross-browser compatibility issues. Though the default Browser Object Model discussed in the last chapter provided a great deal of functionality, much of the implementation of the model was based on influence of one browser, or browser company, over another. Over time, this led to a great deal of cross-browser incompatibility, hampering advanced uses of JavaScript until the last few years.

This changed with the release of the W3C’s recommended Document Object Model (DOM). From the W3C comes this description:

The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure, and style of documents. The document can be further processed, and the results of that processing can be incorporated back into the presented page.

The first release of the DOM was DOM Level 1, issued as a recommendation in 1998. This release helped define the infrastructure for the DOM—the schema and Application Programming Interface (API) that future versions of the DOM could use as a base of functionality. It also helped establish a core component of each recommendation that is required for ...

Get Learning JavaScript 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.