npm.io
0.1.1 • Published 10 years ago

@f/has-class

Licence
MIT
Version
0.1.1
Deps
0
Vulns
0
Weekly
0

has-class

Build status Git tag NPM version Code style

Check whether or not an element has a class

Installation

$ npm install @f/has-class

Usage

var hasClass = require('@f/has-class')

if (hasClass('show', element)) {
  removeClass('show', element)
  addClass('hide', element)
}

API

hasClass(className, element)
  • className - The class you want to see if element has
  • element - The element you want to check for className

Returns: A Boolean value indicating whether or not element has className in its class list.

License

MIT