What is DOM (Document Object Model)?

An interface that represents an HTML or XML document as a tree whose nodes are elements, text and so on, so that programs can read and write it. The browser parses HTML to build the DOM, and JavaScript finds elements with methods such as document.querySelector and changes their text, attributes and styles or adds elements. When the DOM changes, the browser redoes the layout calculation and painting as needed, so too many changes slow down the display.

Japanese name: DOM(Document Object Model)

DOM (Document Object Model) appears in 3 practice questions across 1 topic, including Web Technology Basics.

Field: Web Technology Basics

Try it: questions about DOM (Document Object Model)

Which of the following correctly describes the DOM (Document Object Model) used in browsers?

  1. AA form into which the table structure of a server's database is converted, as HTML tables (table elements), to be sent to the browser
  2. BA representation of an HTML document as a tree whose nodes are elements and so on, which JavaScript can read and write
  3. CA format in which CSS rules are compressed by removing whitespace, to make files smaller and load faster
Show answer and explanation

Answer: B. A representation of an HTML document as a tree whose nodes are elements and so on, which JavaScript can read and write

The browser parses HTML and builds a tree structure (the DOM tree) whose root is the html element and whose nodes include head, body and the paragraphs inside them. JavaScript changes the page through the DOM, finding elements with document.querySelector, rewriting text and attributes, and adding elements. When the DOM changes, the browser redoes the layout calculation and painting as needed. The DOM is standardized as an interface for manipulating documents that does not depend on any particular programming language.

DOM (Document Object Model) in the explanations

Questions that mention DOM (Document Object Model) (3)

  1. Which of the following correctly describes the DOM (Document Object Model) used in browsers?
  2. In the processing a browser does before showing the first screen (the critical rendering path), a <script src="app.js"> written without attributes inside <head> makes the HTML parser stop at that point. Which of the following correctly describes the behavior when the defer attribute is added to this element?
  3. Which of the following correctly describes a Service Worker?

Books on Web Technology Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Related terms

Cookie (HTTP cookie) CORS (cross-origin resource sharing) Event loop HTTP (Hypertext Transfer Protocol) HTTP method HTTP status code JSON (JavaScript Object Notation) JWT (JSON Web Token) OAuth REST API

Back to the glossary