<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
<style type="text/css">
.myred{
border:4px solid red;
}
</style>
<script src="js/jQuery1.11.1.js"></script>
<script src="js/jquery-migrate-1.2.0.js"></script>
<script type="text/javascript">
$(function() {
/* $("input").focus(function() {
$(this).css("background","pink");
}).blur(function() {
$(this).css("background", "");
});*/
/* $("input").bind('focus', function () {
$(this).css("background", "pink");
}).bind('blur', function () {
$(this).css("background", "");
});*/
//5分钟,用一个bind,绑定个事件
/* $("input").bind('focus', function () {
$(this).css("background", "pink");
}).bind('blur', function () {
$(this).css("background", "");
});*/

/*$("input").bind(
{
focus: function () {
$(this).css("background", "pink");
},
blur: function () {
$(this).css("background", "");
}
});*/
$("input").on(
{
focus: function () {
$(this).css("background", "pink");
},
blur: function () {
$(this).css("background", "");
}
});

//卸载所有事件,但是不能用()
// $("input").unbind("focus blur");
$("input").off("focus blur");

//live
$("ul").delegate("li",{

mouseover: function() {
$(this).css("background","pink");
},
mouseout: function () {
$(this).css("background", "");
}
});

$("#btnAdd").live('click',function() {
//深圳
var $obj = $("<li>深圳</li>");
$("ul").append($obj);
}
);

});
</script>
</head>
<body>
用户名:<input type="text"/>
密码:<input type="password"/>
<ul>
<li>北京</li>
<li>上海</li>
<li>广州</li>
</ul>
<input id="btnAdd" value="添加节点" type="button"/>
</body>
</html>

//JQuery的1.9版本以后不再支持 on , live 的函数事件 , 得 引进相应的 jquery-migrate-1.2.0.js插件包才行。

最新文章

  1. Android 中onSaveInstanceState和onRestoreInstanceState学习
  2. css定位position认识
  3. Box2D自定义重力
  4. 点击事件touches与ios的手势UIGestureRecognizer
  5. iTOP-4412 平台基础软件的安装和学习
  6. [Ogre][地形][原创]基于OgreTerrain的地形实现
  7. android APP是否需要缓存?+简单架构
  8. Scrum10-22
  9. bootstrap.css.map这个文件有何用处?该怎能使用它?
  10. C#中HashTable和快速排序的用法
  11. Cython入门Demo(Linux)
  12. Linux之Samba部署
  13. (转) Ensemble Methods for Deep Learning Neural Networks to Reduce Variance and Improve Performance
  14. Linux内核分析 期末总结
  15. 比酒量|2012年蓝桥杯B组题解析第三题-fishers
  16. js飘窗
  17. selenium+python定位元素的方法及使用
  18. hdu 5920(模拟)
  19. arguments对象与Rest参数
  20. OpenERP7.0中非admin帐号新增其它用户问题

热门文章

  1. LTE Module User Documentation(翻译5)——Mobility Model with Buildings
  2. iOS - UIKit
  3. [转载] linux 程序运行过程中替换文件
  4. DOS中文乱码解决
  5. 简单RTOS学习(一) uc/os-II 工程模板建立
  6. linux GO语言配置安装
  7. nexus 2.6需要jdk7才能跑起来
  8. java中的堆内存和栈内存
  9. 转! java 中“==” 与“ .equals ”比较
  10. 20160808_安装JDK7u79