October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

What Is the Document Object Model (DOM)? Definition and Examples

The DOM is a platform-neutral programming interface and logical model that lets software work with document nodes and their relationships.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Document Object Model (DOM) is a programming interface and logical model that represents a document as a hierarchy of related nodes. Programs can use its interfaces to inspect and change a document’s structure or content. In a web browser, JavaScript commonly calls DOM APIs, but the DOM is not part of the JavaScript language.

What does DOM mean?

DOM stands for Document Object Model. The WHATWG DOM Standard describes its original sense as an API for accessing and manipulating documents, especially HTML and XML documents. The standard’s current scope is broader: it defines a platform-neutral model for events, aborting activities and node trees, and uses “document” for markup-based resources that include both static documents and interactive applications.

Put simply, the DOM gives software a defined way to work with a document’s content and relationships without dictating how a browser must store that information internally.

What is a DOM tree?

A DOM tree is a logical hierarchy of nodes. Nodes can have parent and child relationships; some contain other nodes, while others are leaves. A document tree can include a Document node, a doctype, elements and text nodes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For example, the markup <p>Hello, <strong>web</strong>.</p> can be represented with a p element node containing a text node for “Hello, ”, a strong element node containing “web”, and a final text node for “.”. This is a conceptual illustration of the node model: the markup is the written source, while the DOM expresses its structure as related objects.

What does the DOM let programs do?

Code can use DOM interfaces to read document nodes and make changes, such as creating, moving, modifying or removing nodes. It can also attach event listeners so a program can respond to events. These capabilities make the DOM an interface for working with a document, rather than a programming language or a page’s source text.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Is the DOM the same as JavaScript?

No. JavaScript is a programming language; the DOM is an API and model that a host environment, such as a browser, can expose to programs. JavaScript is commonly used to call browser DOM APIs, but HTML, SVG and XML documents being modeled as objects is not a feature of core JavaScript itself. Other languages can also use DOM interfaces where an implementation provides them.

Does the DOM describe how a browser stores a page?

No. The DOM specifies interfaces and logical relationships that programs can work with; it does not require a particular internal data structure, binary representation or persistence mechanism. A browser’s internal implementation is separate from the DOM model visible through its APIs.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Which documents can the DOM represent?

The familiar browser use case is an HTML document, but the DOM model also applies to SVG and XML documents. The current standard frames its scope around markup-based resources more generally, rather than defining the DOM as HTML alone.

For historical context, the W3C’s DOM specifications describe a platform- and language-neutral interface for programs to access and update HTML and XML documents. Those older specifications explain the original purpose; the WHATWG DOM Standard is the current source for the standard’s scope.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.