$ gnpm install component-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.
$ make test
MIT
Copyright 2013 - present © cnpmjs.org | Home |