Adds one or more tokens to a DOMTokenList.
Method of dom/DOMTokenListdom/DOMTokenList
Syntaxvar result = element.add(token);
Parameters token
The token to add to the DOMTokenList.
Return ValueReturns an object of type BooleanBoolean
Examples//adds an item to an element's classList (a DOMTokenList)
function elAddItem(elid,itemadd) {
var classes = document.getElementById(elid).classList;
classes.add(itemadd);
}
Related specifications
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4