toggle click function class add and remove code example
Example 1: jquery toggle class
$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );
Example 2: toggle class jquery
toggleClass
$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );
toggleClass