QamoosTech
FrontendBeginner

DOM

Pronunciationdee-oh-em

Definition

The Document Object Model is a programming interface that represents an HTML or XML document as a tree structure of nodes, allowing scripts to update content, style, and structure.

Where you hear it

- In frontend code when selecting elements or listening for clicks. - During performance discussions about layout shifts and repaints. - When frameworks talk about virtual representations versus real elements.

Examples

  • JavaScript can access elements using document.getElementById to change their text.
  • Updating the DOM directly too many times can slow down web page rendering.

Common mistake

Thinking the DOM is part of the JavaScript language itself, when it is actually a browser API provided to interact with web pages.