DOM - Root Node of the document

1 - About

Root Node of the document

3 - Javascript

Document/documentElement


var rootElement = document.documentElement;
var firstTier = rootElement.childNodes;

// firstTier is the NodeList of the direct children of the root element
console.log("The child nodes of the root element are");
for (var i = 0; i < firstTier.length; i++) {
   // do something with each direct kid of the root element
   // as firstTier[i]
   console.log("Node "+i+": Tag Name="+firstTier[i].tagName+", Node Type="+firstTier[i].nodeType);
}

where:


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap