Open-source IoT Platform - Device management, data collection, processing and visualization.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Artem Halushko f8af340464 pulled with master 7 years ago
..
.npmignore pulled with master 7 years ago
History.md pulled with master 7 years ago
Makefile pulled with master 7 years ago
Readme.md pulled with master 7 years ago
component.json pulled with master 7 years ago
index.js pulled with master 7 years ago
package.json pulled with master 7 years ago

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