I have this code below:
$("#radar_play").click(function(){
console.log(this);
$(this).unbind('click');
$(this).bind('click');
....
.....
.....
}
Then in the <body> tag I have this button below
<button id="radar_play'">PLAY ANIMATION</button>
To me it looks like I am removing the click event(which does work)then re-attaching it.
But the click event never gets bound again. Anyone know why?
You need to specify a handler when re-binding, you could name your closure and use it as follows: