How to add and remove class onClick in jQuery

jQuery |

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