classlist-multiple-values
Use multiple values for classList.add
and classList.remove
methods.
Install
npm install classlist-multiple-values --save
Usage
const multipleValues = ;const element = document; const cl = ; cl;cl; cl;cl;
API
multipleValues(classList)
Returns: Object
Returns improved add
and remove
methods.
classList
Type: Object|DOMTokenList
Object
or DOMTokenList
which must contain add
and remove
methods.
multipleValues.add(values)
values
Type: String[]|String
Array of strings or space-separated string of class values to add to the element.
multipleValues.remove(values)
values
Type: String[]|String
Array of strings or space-separated string of class values to remove from the element.
Test
For local automated tests, run npm run test:automated:local
.
Browser support
Tested in IE9+ and all modern browsers.
License
MIT © Ivan Nikolić