jQuery toggleClass() Method – on click Add, Remove class

Description: Add or remove one or more classes from each element in the set of matched elements, depending on either the class’s presence or the value of the state argument.

$(“.click_to_add_remove”).click(function(){
$(“.add_class_element”).toggleClass(“class_add_remove”);
});

Leave a Comment

Your email address will not be published.