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
From the course: The DOM in JavaScript, jQuery, AngularJS, and React
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Developer tools7m 12s
-
(Locked)
What is the DOM?5m 18s
-
(Locked)
The DOM tree5m 59s
-
(Locked)
nodeType and nodeName properties7m 17s
-
(Locked)
The Node interface10m 50s
-
(Locked)
The Document object12m 8s
-
(Locked)
The Document methods10m 27s
-
(Locked)
Element objects10m 24s
-
(Locked)
Modifying text in the DOM9m 16s
-
(Locked)
Event objects11m 54s
-
(Locked)
Window object6m 56s
-
(Locked)
CSS properties and the DOM13m 50s
-
(Locked)
Traversing the DOM tree10m 18s
-
-
-
-
-
-