jquery toogle class code example
Example 1: jquery toogle
//Toggle between hide and show for all <p> elements:
$("button").click(function(){
$("p").toggle();
});
Example 2: toggle class javascript and jquery
$('.click-class').click(function() {
$('.class-toggle').toggle();
$('.class-toggle').toggleClass('add-class');
})
Example 3: jquery toggle class
$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );