Possible Duplicate:
is there a way to force event to fire only once on given element (per element, not whole document) when using live()?
This is my code:
$('.answerx').live('click', function(){
comprobar($(this).attr('name') , "\'" + $(this).attr('id') + "\'");
})
I want to make it so that once the click has been made, the user is unable to click and run the function again as the function running more than once is making my program go crazy.
So is there a way to make it so that after clicking once it disables further clicks on specific element whose id is $(this).attr('id')
You could mark clicked object as such. There are many ways to do that. For example, add a class.
Additional benefit of adding a class is that you can style disabled element respectively.