Reputation: 798
I have table with td onclick event
<td id="ab2" onclick="popup('test')">Link</td>
I have disable onclick by calling
$(#ab2").prop("onclick", null);
Now i want to enable this link again when some one clicks on enable link below
<a href="#">Enable</a>
Thanks
Upvotes: 0
Views: 1058
Reputation: 10378
use on and off in jQuery they work for it
for enable
$(#ab2").on("click");
for disble
$(#ab2").off("click");
Upvotes: 1
Reputation: 829
Use this..
$("#ab2").unbind("click");
$( "#ab2" ).bind( "click", function() {
alert( "User clicked" );
});
Upvotes: 1