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.
nodeType and nodeName properties
From the course: The DOM in JavaScript, jQuery, AngularJS, and React
nodeType and nodeName properties
- [Instructor] I want to go over two special properties of the node class, the nodeType and nodeName. Now the nodeType is a property that represents the type of node and it returns an integer value assigned to a particular type of node. This type of node is also the read-only property, which means that you cannot change its value. Now the other one the nodeName property is one that would return the name of a current node that you're trying to select. This is also a read-only property, which means you cannot change its value. Now these two nodes are really interesting, they're really important, because sometimes you want to use them to get a certain type of node or get their values to make a certain decision based on the type of node that you want to select. Every object in the DOM is a node and so it turns out that there are about 12 different types of nodes and there used to be more, but many of them are now deprecated and they're low in use. So the question is how do you find out…
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
-
-
-
-
-
-