2R - Document Object Model (DOM) Specifications

Define/Explain the DOM

The DOM is used to take a web page and create a detailed structure of it so that other programming languages can reference it and work with it. The DOM is made up of object nodes that connect together in a tree with parents, children, and siblings as a heirarchy. Each node can be classified as an element, text, or attribute that can be referenced or altered.

DOM Specifications

The DOM Working group at the W3C is responsible for the DOM specifications. They work together with other vendors and WHATWG to create these specifications. One specification is that the DOM gives programmers a language independent structure for them to access and work with. While Javascript is a commonly used language, other languages can also access it just as easily. Additionally, the DOM is usable on many applications. Another specification is that the DOM follows a tree structure. This tree represents the nodes of the page with parents, children, and siblings.

DOM Implementation in Browsers

The browser can use the DOM to access, read, and update every object node in the DOM. The DOM really came into use with browsers when they wanted to use Javascript to access things within a web page. Browser vendors use the DOM to create the DOM tree structure from the HTML. This structure will represent all of the nodes of a web page and how they relate to each other (parent, child, & sibling). This DOM structure is an alternative way of looking at the initial HTML sturcture of the web page.

Summary

The DOM is a key part of how a web page is created and interacted with. As a web developer, it allows us to use programming languages like Javascript to work with the web page to get data, interact with it, and update it as needed. In reading some of the sites I came across, I started to see the real power of the DOM and how it literally allows a programmer to access every part of the page: every element, attribute, or text. I had not before seen how much could be accessed via Javascript using the DOM. It already has me creatively thinking about some of the sites I work on for people and how I can use Javascript with the DOM to create more interactive sites.

References: