正如标题所说我试图禁用OnClick特定的
<div id="test" style="display: block; opacity: 0.89;"></div>
Run Code Online (Sandbox Code Playgroud)
这个div是从外部脚本加载的,它被混淆,所以我看不到具体的代码.
我试图删除这个
$("#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();
});
Run Code Online (Sandbox Code Playgroud)
以上都不是.
编辑:使用.unbind("点击")解决了我的问题; div创建之后.