Tests if a token is part of a DOMTokenList.
Method of dom/DOMTokenListdom/DOMTokenList
Syntaxvar tokenExists = tokenList.contains(token);
Parameters token
The requested token.
Return ValueReturns an object of type BooleanBoolean
Whether the given token exists in the list. Returns true
if the token is present; false
otherwise.
function elHasClass(elid, cls) {
var classes = document.getElementById(elid).classList;
if (classes.contains(cls))
return true;
else
return false;
}
Notes
Throws a SyntaxError
exception if token is empty.
Throws an InvalidCharacterError
exception if token contains any spaces.
Microsoft Developer Network: [Windows Internet Explorer API reference Article]
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