您有个知识币

【退出】

jquery 移除所有jquery绑定的事件

jquery 中移除使用jquery绑定的所有或个别事件,使用unbind方法。

用法简介:

1.移除所有p元素的绑定事件:

$("p").unbind();

2.移除p元素绑定的click事件:

$("p").unbind("click");

$("p").unbind("click",funName);

注意:unbind方法只适用于取消jquery绑定的事件,如果直接使用document.getElementById("btn").onclick=function{//code...}或<div onclick="alert('c')">test</div>,不能通过unbind方法取消(删除)。

 

本文固定链接: http://www.webzhishi.com/jquery-unbind/ | web知识网

jquery 移除所有jquery绑定的事件:等您坐沙发呢!

发表评论