📌  相关文章
📜  javascript 删除事件侦听器不起作用 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:19.755000             🧑  作者: Mango

代码示例1
var someEventHander=function(){
    console.log("do something");
}
var handlerCopy=someEventHandler.bind(var1,var2)
//add listener
document.getElementById("someid").addEventListener('click',handlerCopy,true);
//remove listener 
document.getElementById("someid").removeEventListener('click',handlerCopy,true);