Utils.classes
A module containing a DOM 4 specification-style implementation
of Element::classList
. For more, see the DOM
4 specification section 5.7 (Interface Element, classList),
and the HTML 5 specification section 2.5.7 (Common microsytaxes,
space-separated tokens).
Utils.classes.contains
Warning: this property will return null
if the host environment is detected to be unsuitable;
an if
block or a similar construct should
be used for detection.
Method that wraps contains
,
which in turn checks if a node-like object's
token list contains the token provided.
Return value: Boolean
Utils.classes.containsList
Method that returns a boolean asserting if a node-like object's token list contains an array-like object of tokens.
Return value: Boolean
Utils.classes.add
Warning: this property will return null
if the host environment is detected to be unsuitable;
an if
block or a similar construct should
be used for detection.
Method that wraps add
,
which in turn adds a token to a
node-like object's
token list.
Return value: undefined
Utils.classes.addList
Method that adds an array-like object of tokens to a node-like object's token list.
Return value: undefined
Utils.classes.remove
Warning: this property will return null
if the host environment is detected to be unsuitable;
an if
block or a similar construct should
be used for detection.
Method that wraps remove
,
which in turn removes a token from a
node-like object's
token list.
Return value: undefined
Utils.classes.removeList
Method that removes an array-like object of tokens from a node-like object's token list.
Return value: undefined
Utils.classes.toggle
Warning: this property will return null
if the host environment is detected to be unsuitable;
an if
block or a similar construct should
be used for detection.
Method that wraps toggle
,
which in turn toggles a token in a
node-like object's
token list.
Return value: Boolean
Utils.classes.toggleList
Method that toggles an array-like object of tokens on a node-like object's token list.
Return value: undefined
Utils.classes.item
Warning: this property will return null
if the host environment is detected to be unsuitable;
an if
block or a similar construct should
be used for detection.
Method that fetches a token from a node-like object's token list at the specified index.
Return value: String || null
Utils.classes.get
Warning: this property will return null
if the host environment is detected to be unsuitable;
an if
block or a similar construct should
be used for detection.
Method that returns the token list of a node-like object.
Return value: Array || null