We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is the Document Object Model?

By Vanessa Harvey
Updated: May 16, 2024
Views: 7,094
Share

The document object model (DOM) is a visual representation of a hierarchical template, or map, of all of the objects and properties that are contained in a web document and that can be recognized by a web browser. This browser object model also specifies the various methods or actions available to a programmer that can be performed on or with the objects. The document object model is a representation of programming or, more precisely, scripting possibilities. Although major browsers support a generic DOM, the scripts that work in one browser might not be functional in another. Programmers can, however, safely work with the objects, properties and methods according to a basic DOM that is common to all major Internet browsers.

Web documents appear to be only a single unit within a browser window, but they actually are composed of a variety of objects. They can and often do contain many properties, and they behave in different ways because of the variety of methods that a programmer can apply to the objects of the document. For example, images can appear in a document and are considered to be objects within the document, which is itself an object.

Links also are objects on which programmers can use methods or perform actions, such as having the color of links change when the mouse is hovered over them or having an image appear or change. DOM scripting involves coding or writing small computer programs known as scripts that are embedded into web documents. These scripts add functionality to web pages, including but not limited to the validation of forms, virtual calculators, pop-up messages, simple games, quizzes and even animation.

Programmers create code according to the possibilities of the document object model with which they work, unless they choose to code very conservatively using a generic DOM to avoid the possibility of browser compatibility problems. The document object model is of importance to programmers who write what are known as client side scripts in web development. Web documents are stored on a web server that delivers the pages to the client computer that requested them and that presents them visually to the website visitor via a browser. Scripts embedded in the web pages stored on the web server must run on the client computer according to the document object model of the browser of that client computer.

Share
EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Discussion Comments
Share
https://www.easytechjunkie.com/what-is-the-document-object-model.htm
Copy this link
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.