HTML DOM NodeList.keys() Method
The NodeList keys() method returns an iterator allowing you to go through all keys contained in this object. The keys are unsigned integers.
Parameters: This method takes no parameter.
Return value: This method returns an iterator.
Example: In this example, we will create a NodeList and hence will get an iterator to get all keys from NodeList using this method.
Before Clicking Button:
After Clicking Button: Elements are called using keys iterator.
In the console: Iterator keys can be seen.
- Google Chrome