Created
July 1, 2014 09:13
-
-
Save logeshpaul/69db97f730b858d239c2 to your computer and use it in GitHub Desktop.
Have something happen on a click event, but only once! Unbind the click handler after the element has been clicked once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#my-selector').bind('click', function() { | |
$(this).unbind('click'); | |
alert('Clicked and unbound!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment