adding and removing classes jquery code example
Example: jquery remove and add class
$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );
//OR
if ($( "#foo" ).hasClass('className')) {
$( "#foo" ).removeClass( 'className');
} else {
$( "#foo" ).addClass( 'className');
}