DOM node
One object in the DOM tree, such as an element, a run of text or a comment.
In more detail
Every node has a nodeType number: 1 for elements, 3 for text and 8 for comments. Properties like childNodes return all node kinds, including whitespace text between tags, while element-only properties such as children skip them.
Related terms
- DOM — The tree of objects a browser builds from a web page, which scripts read and change to update what is on screen.
- HTML element — One building block of a web page, such as a paragraph, a button or a section, made of a start tag, its content and an end tag.
- element traversal properties — DOM properties such as children, firstElementChild and nextElementSibling that move between elements while skipping text and comment nodes.
Taught in
- 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