All original content is created in Ukrainian. Not all content has been translated yet. Some posts may only be available in Ukrainian.Learn more

What hierarchy does the DOM (Document Object Model) have?

Post cover: What hierarchy does the DOM (Document Object Model) have?
Table of contentsClick link to navigate to the desired location
This content has been automatically translated from Ukrainian.
DOM Hierarchy (Document Object Model) consists of objects that represent the structure of an HTML or XML document in the form of a tree. The concept of DOM is described in more detail here. Now let's look at the main levels of the DOM hierarchy:

Document

The root object that represents the document itself. It contains all other DOM objects and is the entry point for accessing other elements.

Element

Nodes that represent HTML tags (for example, <div>, <p>, <a>). Elements can have attributes, text content, and nested elements.

Attribute

Attributes that store additional information about elements. For example, class, id, href attributes, etc.

Text

Nodes that represent the text content of an element. They are children of elements but cannot have their own child elements.

Comment

Nodes that represent comments in an HTML or XML document.

DocumentFragment

Used to create and manipulate a group of nodes without affecting the actual document until these nodes are added to the document.

Node

A general class for all nodes in the DOM. Other nodes, such as Element, Text, and Comment, are subtypes of Node.
The DOM hierarchy works like a tree, where each element is a node, and each node can have child nodes, forming a structure similar to a tree with the root at Document and leaves at the level of text nodes or comments.

This post doesn't have any additions from the author yet.

What is .gitignore? What is it for and how to use it
02 Aug 14:58

What is .gitignore? What is it for and how to use it

meme code
meme code@memecode
How to remove the .DS_Store file from a Git repository?
02 Aug 19:34

How to remove the .DS_Store file from a Git repository?

meme code
meme code@memecode
What is an idempotent method?
21 Aug 20:57

What is an idempotent method?

meme code
meme code@memecode
What is a repository?
21 Aug 21:25

What is a repository?

meme code
meme code@memecode
What is a commit in the context of programming and SCM / Git?
21 Aug 21:37

What is a commit in the context of programming and SCM / Git?

meme code
meme code@memecode
What is SCM (Source Control Management)?
21 Aug 21:46

What is SCM (Source Control Management)?

meme code
meme code@memecode
How does an artificial intelligence model work?
15 Sep 16:42

How does an artificial intelligence model work?

meme code
meme code@memecode
What does relational mean (in the context of relational databases)?
21 Sep 08:27

What does relational mean (in the context of relational databases)?

meme code
meme code@memecode
What is an RDBMS (relational database management system)?
21 Sep 08:56

What is an RDBMS (relational database management system)?

meme code
meme code@memecode
What does the ACID principle mean in programming?
24 Sep 20:31

What does the ACID principle mean in programming?

meme code
meme code@memecode
What is Convention over Configuration (in the context of RoR and beyond)?
26 Sep 07:47

What is Convention over Configuration (in the context of RoR and beyond)?

meme code
meme code@memecode
Rounding decimal numbers: mathematical rules, JavaScript, and Ruby
18 Oct 12:59

Rounding decimal numbers: mathematical rules, JavaScript, and Ruby

meme code
meme code@memecode