NodeIterator.referenceNode

  • Revision slug: DOM/NodeIterator.referenceNode
  • Revision title: NodeIterator.referenceNode
  • Revision id: 136545
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 30 words added, 6 words removed

Revision Content

{{ DomRef() }}

{{ fx_minversion_header("3") }}

{{ non-standard_header() }}

Summary

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.

Syntax

node = nodeIterator.referenceNode;

Notes

This property was introduced by WebKit and is used for testing; it can also be used by debuggers.  It is not part of the DOM specification.

Example

var nodeIterator = document.createNodeIterator(
    document.body,
    NodeFilter.SHOW_ELEMENT,
    { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } },
    false
);
node = nodeIterator.referenceNode;

 

Revision Source

<p>{{ DomRef() }}</p>
<p>{{ fx_minversion_header("3") }}</p>
<p>{{ non-standard_header() }}</p>
<h3 name="Summary">Summary</h3>
<p>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.</p>
<h3 name="Syntax">Syntax</h3>
<pre class="eval">node = nodeIterator.referenceNode;
</pre>
<h3>Notes</h3>
<p>This property was introduced by WebKit and is used for testing; it can also be used by debuggers.  It is not part of the DOM specification.</p>
<h3 name="Example">Example</h3>
<pre class="eval">var nodeIterator = document.createNodeIterator(
    document.body,
    NodeFilter.SHOW_ELEMENT,
    { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } },
    false
);
node = nodeIterator.referenceNode;
</pre>
<p> </p>
Revert to this revision