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

 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>
原文地址:https://www.cnblogs.com/kogmaw/p/12493810.html