The TreeWalker filter property returns a Filter node that is a filtering object associated with the created TreeWalker. It is a read-only property.
When creating the TreeWalker, the filter node or object is passed as the third parameter which is retrieved using this property.
nodeFilter = treeWalker.filter;
Return Value: This property returns a node filter of the TreeWalker.
Example: In this example, we will get the node filter of the TreeWalker using this property.
Before Clicking the Button:
After Clicking the Button: In console filter, node can be seen.
- Google Chrome
- Internet Explorer
- HTML DOM TreeWalker root property
- HTML DOM TreeWalker whatToShow property
- HTML DOM TreeWalker currentNode Property
- HTML DOM TreeWalker nextSibling() method
- HTML DOM TreeWalker nextNode() method
- HTML DOM TreeWalker firstChild() method
- HTML DOM TreeWalker lastChild() method
- HTML DOM TreeWalker parentNode() method
- HTML DOM TreeWalker previousSibling() Method
- HTML DOM TreeWalker previousNode() Method
- PHP | Filter and Filter Constant
- AngularJS | filter Filter
- HTML | DOM Style filter Property
- HTML DOM NodeIterator filter property
- CSS | filter Property
- CSS | backdrop-filter Property
- How to perform a real time search and filter on a HTML table?
- HTML SVG <filter>
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.