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?
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?
1 Answer
Reset to default 7Use the toggleClass
function:
$("#tool").click(function() {
$("#drill").toggleClass("spanner");
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745675071a4639636.html
评论列表(0条)