码迷,mamicode.com
首页 > Web开发 > 详细

5.1 jQuery基础

时间:2015-02-18 15:14:09      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:

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.

 

  

  

5.1 jQuery基础

标签:

原文地址:http://www.cnblogs.com/iMirror/p/4295763.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!