Reputation: 13843
When i click #tool
I want to add the class .spanner
to the div #drill
.
However when #drill
has the class .spanner
and #tool
is clicked i want the class to be removed?
Upvotes: 2
Views: 2842
Reputation: 351456
Use the toggleClass
function:
$("#tool").click(function() {
$("#drill").toggleClass("spanner");
});
Upvotes: 7