Skip to content
exactly like .addClass and .removeClass from jquery but without dependencies
JavaScript
Find file
Latest commit e61e8f8 @maxogden 0.2.2
Failed to load latest commit information.
.gitignore 0.0.1
collaborators.md add davidtheclark
index.js add toggle class
package.json 0.2.2
readme.md add toggle class
test.js Improve tests and update tape

readme.md

element-class

like .addClass, .removeClass .toggleClass and .hasClass from jquery but without dependencies

testling badge

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

Something went wrong with that request. Please try again.