Check if an element has the given class.
$ npm install --save has-class
var hasClass = require('has-class');
var el = document.querySelector('div');
hasClass(el, 'foo');
//=> true
Required
Type: HTML DOM element
Element to test with.
Required
Type: string
Class name to test against.
- add-class - Add a given class to elements.
MIT © Andreas Gillström