HTML DOMTokenList values()
❮ The DOMTokenList ObjectExamples
Get a DOMTokenList from "demo":
let list = document.getElementById("demo").classList;
Try it Yourself »
List the keys of the list:
const list = document.body.childNodes;
for (let x of list.keys()) {
text += x;
}
Try it Yourself »
List the values from the list:
const list = document.body.childNodes;
for (let x of list.values()) {
text += x;
}
Try it Yourself »
Description
The values()
method returns an Iterator with the values from a
DOMTokenList.
See Also:
Syntax
domtokenlist.values()
Parameters
NONE |
Return Value
Type | Description |
Object | An Iterator object with the values from the list. |
Browser Support
domtokenlist.values()
is a DOM Level 4 (2015) feature.
It is supported in all modern browsers:
Chrome | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes |
domtokenlist.values()
is not supported in Internet Explorer 11 (or earlier).
❮ The DOMTokenList Object