Reputation: 1221
i want the click() event to fire just once. I can use the removeClass() but doesnt sounds good if i need it again for smthing else.
Any ideas?
Upvotes: 2
Views: 900
Reputation: 124888
You can use .one() to have an event fire just once:
$('#item').one('click', function() {
alert("You'll never see me again!");
});
Upvotes: 13