jQuery Toggle Class
$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );
Matteoweb
$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );
$('.click-class').click(function() {
$('.class-toggle').toggle();
$('.class-toggle').toggleClass('add-class');
})
$('.ButtonClass').on('click', function(e) {
$('.Items').toggleClass("toggleyour CLASS"); //Target Div where toggle class
e.preventDefault();
});
// add class [class-name] if condition is true
// or else remove it
$('#foo-bar').toggleClass('class-name', condition)