0.1.1 • Published 8 years ago

@f/has-class v0.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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