A hub list is an accumulation of nodes
HTML DOM Node List
The getElementsByTagName() strategy restores a node list. A hub list is an exhibit like gathering of nodes.
The following code chooses all <p> hubs in a document:
The hubs can be gotten to by a file number. To get to the second <p> hub you can write:
Note: The record begins at 0.
HTML DOM Node List Length
The length property characterizes the quantity of hubs in a hub list:
document.getElementById("demo").innerHTML = myNodelist.length;
- Get all <p> components in a hub list
- Display the length of the hub list
The length property is helpful when you need to circle through the hubs in a hub list:
Change the foundation shade of all <p> components in a hub list: