Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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
}

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.