Represents a space-separated token list within the DOM, such as the contents of the className property of an element, treated as a zero-based array-like object. DOMTokenList objects are case-sensitive, even when the underlying string might ordinarily be treated in a case-insensitive manner.
- Returns the number of tokens in a DOMTokenList.
- Adds one or more tokens to a DOMTokenList.
- Tests if a token is part of a DOMTokenList.
- Removes one or more tokens from a DOMTokenList.
- Adds a token to a DOMTokenList if it is not present, or removes it if it is. Returns
trueif the token is now present (it was added); returns
falseif it is not (it was removed).
- Returns a specific zero-indexed token from a DOMTokenList.
A DOMTokenList object will stringify to the value of the DOMTokenList object’s underlying string. A set of space-separated tokens is a string containing zero or more words (known as tokens) separated by one or more space characters, where words consist of any string of one or more characters, none of which are space characters (the space characters are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR)).
- W3C DOM4
- Candidate Recommendation
Microsoft Developer Network: [Windows Internet Explorer API reference Article]