views:

48

answers:

1

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?

+3  A: 

Use the toggleClass function:

$("#tool").click(function() {
    $("#drill").toggleClass("spanner");
});
Andrew Hare