DOM
The tree of objects a browser builds from a web page, which scripts read and change to update what is on screen.
In more detail
DOM stands for Document Object Model. Every HTML element becomes a node in the tree, with parent, child and sibling relationships. React, CSS selectors and screen readers all work from this tree.
Examples
In the browser: DOM stands for Document Object Model. Every element, piece of text and comment in the HTML becomes a node in the tree, with the document at the root. Changing the DOM, for example adding a node, can make the browser recalculate styles, layout and paint.Web-first assertions poll the DOM until the expected change appears.React batches its DOM changes and applies only the differences during the commit phase.Related terms
- HTML — The markup language that describes the structure and meaning of a web page with elements such as <button>, <input> and <h2>.
- JavaScript — The programming language of web browsers, also widely used on servers through Node.js.
- accessibility tree — A simplified version of the DOM tree that the browser builds for assistive technology, listing each element's role, name and state.
- DOM node — One object in the DOM tree, such as an element, a run of text or a comment.
- HTML parser — The part of the browser that reads HTML text and builds the DOM tree from it, one token at a time.
- CSSOM — The browser's in-memory model of all the CSS rules on a page, built by parsing stylesheets, which it combines with the DOM to work out each element's style.
- render tree — The tree of visible elements with their computed styles, built from the DOM and CSSOM, that the browser uses for layout and painting.
- web-first assertion — A Playwright assertion that keeps rechecking the page until the condition is true or a timeout expires.
- Virtual DOM — A lightweight copy of the page structure kept as plain JavaScript objects, which a library such as React compares between renders instead of reading the real page.
- hydration — The step where React in the browser attaches event handlers and state to HTML that was already rendered on the server.
- commit phase — The part of an update where React applies the calculated changes to the real DOM, all at once and without interruption.
- layout — The rendering stage in which the browser calculates the exact position and size of every box on the page.
- cross-site scripting — An attack in which someone gets their own script to run inside your page, where it can read data, act as the user or steal tokens.
- output encoding — Converting data into a safe form for the exact place it is written, such as HTML text or an attribute, so the browser shows it instead of running it.
Taught in
- Design Systems Architecture: Foundations, Layers & Taxonomy — Design Systems & Component Engineering
- CSS Custom Properties & Dynamic Theming Architecture — Design Systems & Component Engineering
- Polymorphism & Slotted Composition: The asChild Pattern — Design Systems & Component Engineering
- Overlay Architecture: Portals, Stacking Contexts & Backdrops — Design Systems & Component Engineering
- How Browsers Work: Navigation, DNS, TCP, TLS And Request Timing — Frontend Architecture & Web Platform
- HTML Parsing, Tokenization And The Document Object Model (DOM) — Frontend Architecture & Web Platform
- CSS Parsing, The CSSOM And The Render Tree — Frontend Architecture & Web Platform
- Modern DOM Querying: querySelector, closest And matches — Frontend Architecture & Web Platform
- DOM Manipulation: DocumentFragment And HTML Templates — Frontend Architecture & Web Platform
- MutationObserver: Reactive DOM Watching Without Polling — Frontend Architecture & Web Platform
- End-to-End Testing with Playwright: Multi-Tier Suites — Production Full-Stack Engineering
- App Router Architecture: Server-First Paradigms — Next.js 15 & Modern App Router Architecture
- Server Components: Async Execution & Constraints — Next.js 15 & Modern App Router Architecture
- Root & Nested Layouts: State Preservation Semantics — Next.js 15 & Modern App Router Architecture
- Templates vs Layouts: Remounting & Page Transitions — Next.js 15 & Modern App Router Architecture
- Streaming SSR: Progressive HTML & Chunked Transfers — Next.js 15 & Modern App Router Architecture
- JSX Transpilation: createElement, JSX Runtime, React Elements — React 19 & Modern Component Architecture
- Component Purity: Pure Functions, Idempotence And Side Effects — React 19 & Modern Component Architecture
- State with useState: Immutability And Asynchronous Batching — React 19 & Modern Component Architecture
- Virtual DOM vs Real DOM: The Reconciliation Cost Model — React 19 & Modern Component Architecture
- Keys In Depth: Identity Preservation And Identity Resetting — React 19 & Modern Component Architecture
- Diffing Algorithm: Element Type Shifts And Subtree Tear Down — React 19 & Modern Component Architecture
- SyntheticEvent System: Event Delegation in Modern React — React 19 & Modern Component Architecture
- useEffect Lifecycle: Mount, Dependencies, And Cleanup Phases — React 19 & Modern Component Architecture
- useLayoutEffect vs useEffect: Painting And Synchronous Reads — React 19 & Modern Component Architecture
- useRef Mechanics: DOM References And Mutable Persistent State — React 19 & Modern Component Architecture
- Cross-Site Scripting — Application Security & Threat Modeling for Engineers