HTML DOM NodeList values() Method
- Previous page length
- Next page entries()
- Go back to the previous level HTML DOM NodeList
Definition and Usage
The values() method returns an iterator containing values from the NodeList.
Example
Example 1
List the child nodes of the document:
const list = document.body.childNodes; for (let x of list.values()) { text += x; }
Example 2
List the names of document child nodes:
const list = document.body.childNodes; for (let x of list.values()) { text += x.nodeName; }
Example 3
List the types of document child nodes:
const list = document.body.childNodes; for (let x of list.values()) { text += x.nodeType; }
Syntax
nodelist.values()
Parameters
No parameters.
Return Value
Type | Description |
---|---|
Object | Iterator object containing the values in the list. |
Browser Support
nodelist.values() is a DOM Level 4 (2015) feature.
All modern browsers support it:
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supported | Supported | Supported | Supported | Supported |
Internet Explorer 11 (or earlier versions) does not support nodelist.values().
Related Pages
- Previous page length
- Next page entries()
- Go back to the previous level HTML DOM NodeList