classes-component

Cross-browser element class list

classes

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

$ component install component/classes
var classes = require('classes');
classes(el)
  .add('foo')
  .toggle('bar')
  .remove(/^item-\d+/);

Add class.

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

Toggle class.

Check if class is present.

Return an array of classes.

MIT