Category: jQuery

How to add and remove class onClick in jQuery

September 19th, 2022 by

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"); });

Read More »