I disabled the click event of image using unbind method. But I don’t know how to recover the click event again.
Here is the code,
<img src="testimg.jpg" id="sub_form">
disabled the click event of above image using the code
$('#sub_form').unbind('click');
How do i recover the click event? I tried with the bind event
$('#sub_form').bind('click');
but it wont work.
Why I’m going for click event of image is ajax form submission. The code is,
$("#sub_form").click(function() {
var input_data = $('#testform').serialize();
$.ajax({
//my code
});
});
how can i achieve this after unbind of image is performed.
If you saved the handler, you can just invoke it again:
If you don’t know what handlers that are bound, you can find and save them before unbinding:
http://jsfiddle.net/sPPnE/