Export (0) Print
Expand All

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

 

Syntax

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

Property values

Type: Object

A NodeFilter function that returns ones of the following values:

FILTER_ACCEPT (1)

Accept the node.

FILTER_REJECT (2)

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

FILTER_SKIP (3)

Skip the node. Child nodes are considered.

Standards information

Remarks

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
}

 

 

Community Additions

ADD
Show:
© 2014 Microsoft