NodeIterator.root

The NodeIterator.root read-only property represents the Node that is the root of what the NodeIterator traverses.

Syntax

root = nodeIterator.root;

Example

var nodeIterator = document.createNodeIterator(
    document.body,
    NodeFilter.SHOW_ELEMENT,
    { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } },
    false
);
root = nodeIterator.root; // document.body in this case

Specifications

Specification Status Comment
DOM
The definition of 'NodeIterator.root' in that specification.
Living Standard No change from Document Object Model (DOM) Level 2 Traversal and Range Specification.
Document Object Model (DOM) Level 2 Traversal and Range Specification
The definition of 'NodeIterator.root' in that specification.
Obsolete Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support1123.5993
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes493 Yes

See also

Document Tags and Contributors

Last updated by: ExE-Boss,