createNodeIterator

fun createNodeIterator(root: Node, whatToShow: Int = definedExternally, filter: NodeFilter? = definedExternally): NodeIterator(source)

Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.

Parameters

root

The root element or node to start traversing on.

whatToShow

The type of nodes or elements to appear in the node list

filter

A custom NodeFilter function to use. For more information, see filter. Use null for no filter.

MDN Reference