filter property

Gets the function object that the iterator uses to filter nodes that go into TreeWalker hierarchies or NodeIterator lists.

Document Object Model (DOM) Level 2 Traversal and Range Specification, Section 1.2Internet Explorer 9



HRESULT value = object.get_filter(** p);

Property values

Type: Object

A NodeFilter function that returns ones of the following values:


Accept the node.


Reject the node. For TreeWalker, child nodes are also rejected. For NodeIterator, this flag is synonymous with FILTER_SKIP.


Skip the node. Child nodes are considered.

Standards information


The NodeFilter is a callback function that provides customized filtering for NodeIterator and TreeWalker. The filter function accepts a node as its only parameter, and indicates whether the node is accepted, rejected, or skipped.

function myFilter(node) {
    // NodeFilter function that returns one of the following flags:
    // NodeFilter.FILTER_ACCEPT, NodeFilter.FILTER_REJECT, NodeFilter.FILTER_SKIP