jquery remove and add class
snippet in javascript

jquery remove and add class

user1869

$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );

//OR
if ($( "#foo" ).hasClass('className')) {
	$( "#foo" ).removeClass( 'className');
} else {
  $( "#foo" ).addClass( 'className');
}

jquery remove multiple class

user4752

$("p").removeClass("blue under");