HTML DOMTokenList entries()
❮ The DOMTokenList ObjectExamples
Get a DOMTokenList from "demo":
let list = document.getElementById("demo").classList;
Try it Yourself »
List the entries of the list:
for (let x of list.entries()) {
text += x[0] + " " + x[1];
}
Try it Yourself »
Description
The entries()
method returns an Iterator with the key/value pairs from a
DOMTokenList.
See Also:
Syntax
domtokenlist.entries()
Parameters
NONE |
Return Value
Type | Description |
Object | An Iterator object with the key/value pairs from the list. |
Browser Support
domtokenlist.entries()
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.entries()
is not supported in Internet Explorer 11 (or earlier).
❮ The DOMTokenList Object