jquery on方法
来源:互联网 发布:瓷砖排版软件下载 编辑:程序博客网 时间:2024/05/18 00:46
jquery on方法可以操作未来的元素 相当于旧版本的live方法 看代码
<html>
<head>
<meta charset='utf-8'>
<title>on</title>
<script src="./jquery.js"></script>
</head>
<style>
#prediv{
min-height:20px;
min-width:20px;
background:#eee;
border:1px solid #ddd;
}
</style>
<body>
<div id="prediv"></div>
<button>add</button>
<script>
$(function(){
$("body").on('click','p',function(){
var pId = $(this).attr('id');
alert(1);
})
$('button').on('click',function(){
var eleStr = '<p id="idp">p元素</p>';
($("#prediv").after($(eleStr)));
})
})
</script>
</body>
</html>
0 0
- jQuery之.on()方法
- jQuery on()方法
- jQuery on()方法
- jquery on()方法
- jQuery on()方法
- jQuery on()方法
- jQuery on()方法
- jQuery on()方法
- jQuery中的on方法
- jQuery on()方法
- jQuery on()方法
- jQuery on()方法
- jquery on方法详解
- jQuery on()方法
- jQuery的on方法
- jQuery on()方法
- jquery on方法
- jQuery on()方法
- centos下redis安装
- Kafka初识
- 第六章 事件控制块
- QGIS二次开发包下载
- 第七天:整理S5PV210三种刷机方式 及自身问题总结
- jquery on方法
- HTML——转义字符
- java8之接口的默认静态方法
- 【操作系统】死锁-思维导图
- 三种动画效果(Frame, View, Property)实现
- 《Windows环境下32位汇编语言程序设计(第2版)》-chapter3补
- listen()函数中backlog参数分析
- python 编译过程 从py文件到bytecode
- 【操作系统】处理机调度-思维导图