just.ClassList(element)
Members
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.
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