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

The inter-wiki (WebApi) does not exist and there is no default inter-wiki defined.

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
Browser
Browser - Document variable (DOM) - Javascript

In a browser, the document is: a DOM document (in-memory tree) of a XML document (generally a HTML dom document) The document is provided by the browser via its DOM webapi (Not by the Javascript...
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 - Document

An HTML document is a well-formed HTML string (ie that contains the html root element). web page The HTML textual representation can be stored: in a string in a file or in the body of an HTTP...
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 about 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...



Share this page:
Follow us:
Task Runner