DEV Community

Cover image for What is a DOM?
Sai Pavan
Sai Pavan

Posted on • Edited on

What is a DOM?

The Document Object Model is known as a programming interface used for web documents so that programs can change the document structure, style, and content representing a page.

There is an interaction between pages, nodes and object. In the case of the object model it allows the representation to be manipulated. This is object based and it can be modified using javascript.
It was designed to be independent of any particular programming language, making the structural representation of the document available from a single, consistent API.

Even if most web developers will only use the DOM through JavaScript, implementations of this can be built for any language.
JavaScript can also be used in other contexts.

For example, Node.js runs JavaScript programs on a computer, but provides a different set of APIs, and the DOM API is not a core part of the Node.js runtime. In short DOM is not necessarily a part of the JavaScript, but a Web API which builds websites.

If we take an example of a HTML DOM, a document containing HTML is being described as the Document interface that can be extended by HTML specification which includes HTML-specific features. An Element interface is enhanced to transform into an HTMLElement and are of various subclasses.

Top comments (0)