🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

classlist-multiple-values

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

classlist-multiple-values

Use multiple values for `classList.add` and `classList.remove` methods.

1.0.1
latest
Source
npm
Version published
Weekly downloads
652
2.68%
Maintainers
1
Weekly downloads
 
Created
Source

classlist-multiple-values

Build Status BrowserStack Status

Use multiple values for classList.add and classList.remove methods.

Install

npm install classlist-multiple-values --save

Usage

const multipleValues = require('classlist-multiple-values');
const element = document.querySelector('.jackie');

const cl = multipleValues(element.classList);

cl.add('henry winnie');
cl.add(['scooter', 'emma']);

cl.remove('henry winnie');
cl.remove(['scooter', 'emma']);

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ć

Keywords

add

FAQs

Package last updated on 09 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts