The following example will show how to use the jQuery toggleClass() method. This method toggles between adding/removing classes from the elements: $("button").click(function(){ $("h1, h2, p").toggleClass("blue"); });
The following example will show how to use the jQuery toggleClass() method. This method toggles between adding/removing classes from the elements: $("button").click(function(){ $("h1, h2, p").toggleClass("blue"); });