JavaScript 'hasClass'

To determine whether an element contains a specified class name.

Demo - //jsfiddle.net/toddmotto/3mffU/

Get Code

JavaScript 'addClass'

To add a specific class name to an element.

Demo - //jsfiddle.net/toddmotto/V489X/

Get Code

JavaScript 'removeClass'

To remove a specific class name from an element.

Demo - //jsfiddle.net/toddmotto/6uQ58/

Get Code

JavaScript 'toggleClass'

Add/remove a specific class, toggle it.

Demo - //jsfiddle.net/toddmotto/6UwF3/

Get Code