欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

jQuery绑定事件监听bind和移除事件监听unbind用法实例详解_jquery

程序员文章站 2022-04-03 19:15:06
...
本文实例讲述了jQuery绑定事件监听bind和移除事件监听unbind用法。分享给大家供大家参考,具体如下:

这里分别采用后bind(eventType,[data],Listener)//data为可选参数,one()该方法绑定的事件触发一次后自动删除,unbind(eventType,Listener),

实例:



unbind(eventType,listener)
"); }) .bind("click",function(){ $("#show").append("
点击事件2
"); }) .bind("click",function(){ $("#show").append("
点击事件3
"); }); $("input[type=button]").click(function(){ $("img").unbind("click",fnMyFunc1); //移除事件监听myFunc1 }); }); jQuery绑定事件监听bind和移除事件监听unbind用法实例详解_jquery