Understanding nodeType, nodeName, and nodeValue


show more Understanding nodeType, nodeName, and nodeValue provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript: Enhancing the DOM show less
please wait ...

Understanding nodeType, nodeName, and nodeValue

Every DOM element has a few important properties you can use to identify the node. So we're going to take a look at some of those properties in this movie. So, for example, the nodeType property gives you a numerical value of a node. The nodeName property gives you the name of the node, usually the tagName. So for example an anchor tag would have a type of A. Node.atrributes is a how you can access attributes inside a node. So if you were inside an anchor tag you could ask for a list of attributes and get the href attribute. Also the node value let's you access an element inside a node. So let's take a look at these in an actual document. So here we are in our sample file.

I'm going to hit Cmd+Option+I, Ctrl+Alt+I on the PC and then hit the Esc key to pull up the console. So I'll start out by creating a variable called myNode, and then assigning it an element in our page. In this case, I'm going to choose the last link in our navigation menu, which ...

Understanding nodeType, nodeName, and nodeValue
Video duration: 4m 30s 2h 3m Intermediate

Viewers:

Understanding nodeType, nodeName, and nodeValue provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the JavaScript: Enhancing the DOM

Subjects:
Developer Web
Software:
HTML JavaScript
Author:
please wait ...