Repaso
Español

What is the DOM?

Options

  1. A database that stores the content of the page
  2. A tree of objects built from the HTML (editable) (Correct option)
  3. A CSS framework used for building page layouts
  4. A server that sends HTML files to the browser

Answer

The tree of objects the browser builds from the HTML, which JavaScript can read and change

Why

The browser reads the HTML text and builds the Document Object Model: a tree where each tag is a node (document → html → body → div → button...).

JavaScript changes the page by changing this tree, e.g. adding an element or changing its text, and the browser redraws what changed.

Remember

DOM = the live tree of the page that JS manipulates.

Key terms

Practice this question in Repaso