DEV Community

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

Posted on • Edited on

1

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.

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more