HTML DOMTokenList entries()

❮ The DOMTokenList Object

Examples

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.




Syntax

domtokenlist.entries()

Parameters

NONE

Return Value

Type Description
ObjectAn 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
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.