element-class
v0.2.2
Published
add and remove classes from dom elements
Downloads
238,962
Keywords
Readme
element-class
like .addClass, .removeClass .toggleClass and .hasClass from jquery but without dependencies
npm install element-class
var elementClass = require('element-class')
// get an element
var foo = document.querySelector('.foo')
// remove a class
elementClass(foo).remove('foo')
// add a class
elementClass(foo).add('foo')
// toggle a class
elementClass(foo).toggle('foo')
// check if element has a class
elementClass(foo).has('foo')
license
BSD