DOM - Root Node of the document

About

The root Node is the root of the document tree.

In styling / positioning, the root node is the default node for any absolute positioning

Javascript

en-US/docs/Web/API/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:





Discover More
CSS - Viewport (Reader's window)

The viewport is the viewing area on a screen media. It's then a property of media. The top media of a browser is the window (ie browser tab) As an iframe create a new window, you can set a new viewport...
Domtree
DOM - (Node) Tree

The DOM presents an (XML|HTML) document as a tree-structure. A DOM has a standard tree structure, where each node contains one of the components from an XML structure. Generally, the vast majority of...
HTML - HTML element (Document root)

The html element represents the root of a a html document (page). It would become also the root (top node) in the in-memory tree representation (DOM document) of this html page. This is also the node...
Domtree
How is the DOM document build from an HTML document ?

This page is the construction of the DOM document from a HTML document (ie the XML language is xhtml) HTMLAPIHTML The HTML dom document is created: by an xml library or by the browser at page...



Share this page:
Follow us:
Task Runner