1. jquery.com 下载
api.jQuery.com 查看api important!!!
2. 绑定事件
http://api.jquery.com/category/events/
bind():attach a handler to an event, As of jQuery 1.7, the .on()
method is the preferred method for attaching event handlers to a document
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>jQuery</title> <script src="jquery-2.1.3.min.js"></script> <script src="myJs.js"></script> </head> <body> <button id="btn">Click</button> </body> </html>
/** * Created by Administrator on 2015/2/18. */ $(document).ready(function () { $("#btn").on("click",clickhandler1); $("#btn").on("click",clickhandler2); $("#btn").off("click",clickhandler1); }); function clickhandler1(e){ console.log("clickhandler1"); } function clickhandler2(e){ console.log("clickhandler2"); }
3.
原文:http://www.cnblogs.com/iMirror/p/4295763.html