From the course: The DOM in JavaScript, jQuery, AngularJS, and React

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The DOM tree

The DOM tree

From the course: The DOM in JavaScript, jQuery, AngularJS, and React

Start my 1-month free trial

The DOM tree

- [Instructor] In general, a tree is a finite, hierarchical tree structure where objects or elements are pre-ordered, depth-first, top down. The DOM tree is represented in this same fashion. Let's take a look at characteristics of the DOM tree. Elements or objects of a tree have the following general characteristics, an element adds the parent, which is another element, and if it does not have a parent element then it returns a null value. The second is child element. An element can also have child elements and if the list has no children then it returns a null value. Now the third characteristic is important, it's the root element. So let's take a close look at the concept of the root element. The concept of a root element is when the root or the parent of an element is itself, if it's parent is null. So following this concept in the DOM, the html element is the root element of the web document because it does not have a parent element and it is itself its parent. And if an element…

Contents