dom-classes

Add, change, remove DOM classes

Cross-browser element class manipulation, utilizing the native .classList when possible. This is not designed to be a .classList polyfill.

$ npm install dom-classes
classes = require('dom-classes')
 
classes(el)
// => ['foo', 'bar'] 

Return an array of classes

classes(el)
// => ['foo', 'bar']

Add class

Remove class name or all classes matching the given regular expression.

Toggle class.

Check if class is present.

Check if class is present.