Developer Dictionary
DOM
Definition
Document Object Model; a programming interface for HTML and XML documents.
Deep Dive
The Document Object Model (DOM) is a programming interface for HTML and XML documents. It represents the page structure as a logical tree, where each element, attribute, and piece of text in a web document becomes a node in the tree. This object-oriented representation allows programming languages, most commonly JavaScript, to access, manipulate, and update the content, structure, and style of documents dynamically after they have been loaded by the browser, without needing to reload the entire page.
Examples & Use Cases
- 1JavaScript changing the text content of a `<p>` tag on a webpage
- 2Dynamically adding a new `<div>` element to a webpage after a user action
- 3React or Angular frameworks using a "virtual DOM" for efficient updates to the actual DOM
Related Terms
HTMLJavaScriptBrowser Engine