小宝贝 2332bb7261 node 2 سال پیش
..
.npmignore 2332bb7261 node 2 سال پیش
History.md 2332bb7261 node 2 سال پیش
Makefile 2332bb7261 node 2 سال پیش
Readme.md 2332bb7261 node 2 سال پیش
component.json 2332bb7261 node 2 سال پیش
index.js 2332bb7261 node 2 سال پیش
package.json 2332bb7261 node 2 سال پیش

Readme.md

classes

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

Installation

$ component install component/classes

Example

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

API

.add(class)

Add class.

.remove(class)

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

.toggle(class)

Toggle class.

.has(class)

Check if class is present.

.array()

Return an array of classes.

Test

$ make test

License

MIT