阅读背景:

绑定按钮点击click事件

来源:互联网 
<!--方法一, 建议-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="https://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> </head> <body> <button type="button" id="buttonid">绑定点击事件</button> <script> $('#buttonid').bind('click', function() { console.log('button has clicked!'); }); </script> </body> </html> <!DOCTYPE html PUBLIC "-//W3C



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: