新增 数据行 -jquery
来源:互联网 发布:服务器性能监测软件 编辑:程序博客网 时间:2024/05/16 12:43
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>
<body>
<script id="li-list" type="text/x-jquery-tmpl">
<li>
<label>${num}.</label>
姓名:<input type="text" value="" name="name[${num}]" />
年龄:<input type="text" value="" name="age[${num}]"/>
<button _val='del'><img src="images/del.png" /></button>
<button _val='add'><img src="images/plus.png" /></button>
</li>
</script>
<ul id="myul">
</ul>
</body>
</html>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/jquery.tmpl.js"></script>
<script type="text/javascript">
var num=1;
function add(){
$("#li-list").tmpl({num:$("ul>li").length}).appendTo("#myul");
$('ul>li:not(:last)>button').filter("[_val='add']").hide();
$("ul li:last button").filter("[_avl='add']").show();
$("ul li:not(:last) button").filter("[_val='del']").show();
$("ul li:last button").filter("[_val='del']").hide();
}
$(document).ready(function(){
$("ul>li>button").live("click",function(){
if($(this).attr('_val')=='add'){
add();
}else{
$(this).parent().remove();
}
});
add();
});
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>
<body>
<script id="li-list" type="text/x-jquery-tmpl">
<li>
<label>${num}.</label>
姓名:<input type="text" value="" name="name[${num}]" />
年龄:<input type="text" value="" name="age[${num}]"/>
<button _val='del'><img src="images/del.png" /></button>
<button _val='add'><img src="images/plus.png" /></button>
</li>
</script>
<ul id="myul">
</ul>
</body>
</html>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/jquery.tmpl.js"></script>
<script type="text/javascript">
var num=1;
function add(){
$("#li-list").tmpl({num:$("ul>li").length}).appendTo("#myul");
$('ul>li:not(:last)>button').filter("[_val='add']").hide();
$("ul li:last button").filter("[_avl='add']").show();
$("ul li:not(:last) button").filter("[_val='del']").show();
$("ul li:last button").filter("[_val='del']").hide();
}
$(document).ready(function(){
$("ul>li>button").live("click",function(){
if($(this).attr('_val')=='add'){
add();
}else{
$(this).parent().remove();
}
});
add();
});
</script>
- 新增 数据行 -jquery
- jquery动态新增行、删除行
- jquery 处理table行新增删除问题
- jquery 新增用户实例
- jquery实现table新增、删除行,并实现sum统计
- 原生js,jquery通过ajax获得后台json数据动态新增页面元素
- 新增数据时报错
- elasticSearch 新增数据
- sqlserver批量新增数据
- 批量新增数据
- nopCommerce新增示例数据
- 201711122237->mysql新增数据
- GridView动态新增行 删除行 适合多数据批量修改保存 新增数据验证
- Jquery 1.3以上 新增函数
- (初学日记)repeater动态添加行,保存新增数据
- Axure中继器新增一条数据&删除标记行
- 实现datagrid的foot中增加一个新增数据行,以解决datagrid不能新增数据的问题
- 实现datagrid的foot中增加一个新增数据行,以解决datagrid不能新增数据的问题
- jquery each 操作
- 关于cannot open file 'LIBC.lib'错误的解决
- Some more useful information from 'Diagnostics: Apps Check'
- jquery tmpl
- Spring常见错误解决方案
- 新增 数据行 -jquery
- 创建WinPE启动盘、常用imagex指令、常用dism指令
- Hive 进化最终方向:列数据库
- jquery Data Linking
- 《浅谈利用RSA算法防止非法注册机的制作》
- The ? 1 ? 2 ? ... ? n = k problem
- apt命令用法
- warning C4819: The file contains a character that cannot be represented in the current code page
- mysql 字段操作 命令