as the title says I'm trying to disable OnClick for specific
<div id="test" style="display: block; opacity: 0.89;"></div>
this div is loaded from external script which is obfuscated so i cannot see the specific code.
What I have tried to remove this
$("#test").click(function(){ return false});
$("#test").unbind();
$("#test").removeAttr("onclick");
//Suggestions which do not work
$('#test').on('click', function(e) {e.preventDefault();return false;});
$("#test").click(function(event){
event.preventDefault();
});
None of the above work.
EDIT: Solved my problem using .unbind("click"); after the div was created.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…