JavaScript document.createTreeWalker() Method
JavaScript document.createTreeWalker() Method
The document.createTreeWalker()
method returns a newly created TreeWalker object.
Example
Syntax
Parameter Values
Value | Type | Explanation |
---|---|---|
root | Required | Specifies the root node at which to begin the NodeIterator's traversal. |
whatToShow | Optional | Specifies a convenient way of filtering for certain types of node. The following are the constant properties of NodeFilter. NodeFilter.SHOW_ALLShows all nodes. NodeFilter.SHOW_COMMENTShows Comment nodes. NodeFilter.SHOW_DOCUMENTShows Document nodes. NodeFilter.SHOW_DOCUMENT_FRAGMENTShows DocumentFragment nodes. NodeFilter.SHOW_DOCUMENT_TYPEShows DocumentType nodes. NodeFilter.SHOW_ELEMENTShows Element nodes. NodeFilter.SHOW_PROCESSING_INSTRUCTIONShows ProcessingInstruction nodes. NodeFilter.SHOW_TEXTShows Text nodes. NodeFilter.SHOW_ATTRIBUTEShows attribute Attr nodes. NodeFilter.SHOW_CDATA_SECTIONShows CDATASection nodes. NodeFilter.SHOW_ENTITYShows Entity nodes. NodeFilter.SHOW_ENTITY_REFERENCEShows EntityReference nodes. NodeFilter.SHOW_NOTATIONShows Notation nodes. |
filter | Optional | Specifies an object implementing the NodeFilter interface. |
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.