1.0.6 • Published 9 years ago

has-class v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

has-class

Check if an element has the given class.

Install

$ npm install --save has-class

Usage

var hasClass = require('has-class');
var el = document.querySelector('div');

hasClass(el, 'foo');
//=> true

Browser API

hasClass(element, className)

element

Required
Type: HTML DOM element

Element to test with.

className

Required
Type: string

Class name to test against.

Related

License

MIT © Andreas Gillström