Say I have something like the following to trap the click event of a button:
$(\"#button_id\").click(function() { //disable click event //do something
$("#button_id").click(function() { if($(this).data('dont')==1) return; $(this).data('dont',1); //do something $(this).data('dont',0); }
Remeber that $.data() would work only for items with ID.