The DOMTokenList interface represents a set of space-separated tokens.
DOMTokenList
MDN Reference
The read-only length property of the DOMTokenList interface is an integer representing the number of objects stored in the object.
length
integer
The value property of the DOMTokenList interface is a stringifier that returns the value of the list serialized as a string, or clears and sets the list to the given value.
value
The add() method of the DOMTokenList interface adds the given tokens to the list, omitting any that are already present.
add()
The contains() method of the DOMTokenList interface returns a boolean value — true if the underlying list contains the given token, otherwise false.
contains()
true
false
The item() method of the DOMTokenList interface returns an item in the list, determined by its position in the list, its index.
item()
The remove() method of the DOMTokenList interface removes the specified tokens from the list.
remove()
The replace() method of the DOMTokenList interface replaces an existing token with a new token.
replace()
The supports() method of the DOMTokenList interface returns true if a given token is in the associated attribute's supported tokens.
supports()
token
The toggle() method of the DOMTokenList interface removes an existing token from the list and returns false.
toggle()