Skip to content

gillstrom/has-class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Check if an element has the given class.

Resources

License

Stars

Watchers

Forks

Packages

No packages published