首页 > Web开发 > 详细

第二十五节 jQuery中bind绑定事件和解绑

时间:2020-03-14 21:08:30      阅读:66      评论:0      收藏:0      [点我收藏+]
 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6     <script type="text/javascript" src="../jquery-1.12.4.min.js"></script>
 7     <script type="text/javascript">
 8         $(function(){
 9             // bind的第一个参数可以同时给多个事件,用空格隔开
10             $(#btn).bind(click mouseover mouseout, function(){
11                 alert(click事件);
12 
13                 // 解绑事件
14                 $(this).unbind(mouseover mouseout);
15             })
16         });
17     </script>
18 </head>
19 <body>
20     <input type="button" name="" value="按钮" id="btn">
21 </body>
22 </html>

 

第二十五节 jQuery中bind绑定事件和解绑

原文:https://www.cnblogs.com/kogmaw/p/12493810.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!