| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator/referenceNode | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since April 2018.
The NodeIterator.referenceNode read-only property returns the
Node to which the iterator is anchored; as new nodes are inserted, the
iterator remains anchored to the reference node as specified by this property.
A Node.
const nodeIterator = document.createNodeIterator(
document.body,
NodeFilter.SHOW_ELEMENT,
{
acceptNode(node) {
return NodeFilter.FILTER_ACCEPT;
},
},
);
node = nodeIterator.referenceNode;
| Specification |
|---|
| DOM # dom-nodeiterator-referencenode |
NodeIteratorThis page was last modified on Jul 7, 2023 by MDN contributors.
NodeIteratorAbortControllerAbortSignalAbstractRangeAttrCDATASectionCharacterDataCommentCustomEventDOMErrorDOMExceptionDOMImplementationDOMParserDOMTokenListDocumentDocumentFragmentDocumentTypeElementEventEventTargetHTMLCollectionMutationObserverMutationRecordNamedNodeMapNodeNodeListProcessingInstructionQuotaExceededErrorRangeShadowRootStaticRangeTextTreeWalkerXMLDocumentXPathEvaluatorXPathExpressionXPathResultXSLTProcessorYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |