Document Object Model (DOM)
Definition
The DOM makes the structure of a web document accessible as a programmable tree structure.
The Document Object Model represents a document as a tree of nodes and objects. Programs can read or modify elements, content, and attributes through it and respond to events. The DOM is an interface to the document structure, not a programming language itself.
Simply explained
The browser organizes the page like a family tree, whose individual parts a program can address.
Why it matters in practice
DOM access enables interactive interfaces, such as updated form hints or collapsible sections.
Example from business
Possible example: After an invalid input, JavaScript adds a clear error message to the affected form field in the DOM.
Limits and pitfalls
- The current DOM state can differ from the originally delivered HTML. Careless insertion of foreign content can cause security issues.
Origin & history
The DOM connects documents with programmatic access; on the web it is often used together with JavaScript.
Use in mid-sized companies
- Development teams use unique element structures and test dynamic changes also with keyboard and assistive technologies.
Frequently asked questions
Is DOM the same as HTML?
No. HTML describes the document; the DOM is its structure accessible in the browser and can be modified afterwards.
Sources
- Document Object Model. · MDN contributors (o. J.): Document Object Model.
Editorially reviewed on: