Huge News!Announcing our $40M Series B led by Abstract Ventures.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
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc