I want to disable click event for image using image id
eg. for id12
i want to disabled click event . i tried using unbind but it seems it only works if event is binded using j query?
I want to disable click event for image using image id
eg. for id12
i want to disabled click event . i tried using unbind but it seems it only works if event is binded using j query?
-
You can try this,
onclick="return false;"
– Satpal Commented May 24, 2013 at 13:19 -
unbind
should work for any events; additionally tryoff
for newer Query versions – feeela Commented May 24, 2013 at 13:19 - are i have div on click of Div inside click function i want to disable image click event – KhAn SaAb Commented May 24, 2013 at 13:21
6 Answers
Reset to default 7$("#id12").on('click',function(e){
e.preventDefault();
});
$("#id12").on('click',function(){
return false;
});
$("#id12").click(function () { return false; });
$("#id12").on('click',function(e){
e.preventDefault();
});
$("#id12").on('click',function(e){
e.preventDefault();
});
Below is pure javascript code. Try this :
document.getElementById('id12').setAttribute("onclick", null);
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745136592a4613230.html
评论列表(0条)