DOM Specification

Define/Explain the DOM

The DOM, or Document Object Model, is an API (application programming interface), an interface that is a representation of the code the builds a web page. Since it is not the actual code, but a representation of the code, other programs or scripting languages (such as Javascript or Python) can manipulate or change data, such as structure, style and content, to affect the appearance, behavior or interactivity of the page without changing or affecting the base code. This allows the page to be active and dynamic instead of static.

The DOM is frequently described as a "tree" showing the organization and hierarchical relationships in the document of the objects that comprise the document. The objects represent the different structural pieces of a document that are able to be accessed and manipulated.

DOM Specifications

As web pages are rendered in browsers, and there are many browsers currently in use, there needed to be a way to ensure that web pages would be rendered as accurately as possible regardless of the browser being used. The W3C took on the task of drafting and formalizing a DOM specification. This provides a standard programming interface which can be used by a wide variety of applications and languages. It is therefore considered to be application and language neutral, as it is not tied to any specific one.

The W3C chose to define the specifications in Corba 2.2 in OMG IDL. Currently the DOM specifications are maintained by WHATWG (Web Hypertext Application Technology Working Group), who work to ensure the specifications are correctly implementated.

DOM Implementation in Browsers

When a user requests a web page from the browser, the browser will get the code from the server and returns it as a document object, "DOMimplementation", using a property of "Document.implementation". The code WHATWG gives for this implementation is:

code snippet

Documentation

Resources