Class: ClassList

just.ClassList(element)

Chainable methods for the classList property.
Source:
core.js, line 350

Parameters:

Name Type Description
element
Element The target.
Example
let force;

ClassList(button)
    .add('a', 'b', 'c')
    .remove('b')
    .toggle('c', (force = true))
    .replace('a', 'z')
    .contains('b'); // false

Members

element :Element

Source:
core.js, line 355
Type:

Element

Methods

apply(element, methodName, methodArgsopt)

Simulate Element.classList.prototype.method.apply(element, args) since it's not possible to call a classList-method that way.
Source:
core.js, line 375
Parameters:
Name Type Default Description
element
Element The target.
methodName
string The name of the classList method to call.
methodArgs
[optional]
array[] or Any [methodArgs] Arguments for the classList method.
Returns:
Whatever the method returns.
Example
ClassList.apply(this, 'add', ['x', 'b']); // > undefined
ClassList.apply(this, 'remove', 'c'); // > undefined
ClassList.apply(this, 'toggle', ['a', true]); // > true