首页 > Web开发 > 详细

5.1 jQuery基础

时间:2015-02-18 15:11:40      阅读:259      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!