jquery-add-prefixed-class

0.1.2 • Public • Published

jquery.addPrefixedClass

A jQuery plugin for adding mutually-exclusive classes to DOM elements

Install

$ bower install jquery.add-prefixed-class --save

Usage

$('div.mynode').addPrefixedClass('foo', 'bar')
// div.mynode becomes div.mynode.foo-bar

$('div.mynode').addPrefixedClass('foo', 'baz')
// div.mynode.foo-bar becomes div.mynode.foo-baz

$('div.mynode').removePrefixedClass('foo')
// div.mynode.foo-baz becomes div.mynode

Package Sidebar

Install

npm i jquery-add-prefixed-class

Weekly Downloads

9

Version

0.1.2

License

MIT

Last publish

Collaborators

  • pascalpp