juery实现多行添加,
来源:互联网 发布:傻妹妹雾化器完美数据 编辑:程序博客网 时间:2024/05/21 05:44
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>jQuery联系</title>
<script src='./jquery-1.9.1.min.js'></script>
</head>
<center>
<tr>
<td>ID</td>
<td>姓名</td>
<td>职位</td>
<td>薪水</td>
</tr>
<div >
<table border=1>
<tr>
<td>1</td>
<td>张三</td>
<td>前端</td>
<td>13k</td>
</tr>
</table>
<input type='button' value='+增加一行' class='but'>
</div>
</body>
<script>
$(function(){
$('.but').click(function(){
$('div:first').clone(true).insertAfter('div:last').append("<input type='button' value='-' class='del'>");
$('.del').click(function(){
$(this).parent().remove();
})
})
})
</script>
juery批量添加表单
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="./jquery-1.9.1.min.js"></script>
</head>
<body>
<p id="bb"><input type="text"/></p>
<input type="button"value="点击" class="aa"/>
</body>
</html>
<script>
$(function(){
$('.aa').click(function(){
var html='<p id="bb"><input type="text"/><span onclick="fun(this)"><button>删除</button></span></p>';
$('#bb').after(html);
})
// $('.ss').click(function(){
// $(this).parent().remove();
// })
})
function fun(ts){
$(ts).parent().remove();
}
</script>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<script src="./jquery-1.9.1.min.js"></script>
<body>
<p id="c">文件<input type="text"/><button name="add">添加</button></p>
</body>
</html>
<script>
$(document).on('click','button[name="add"]',function(){
$("#c").after("<p>文件<input type='text'/><button name='add'>添加</button><button name='del'>删除</button></p>");
});
$(document).on('click','button[name="del"]',function(){
var del = $(this).parent();
del.remove();
});
</script>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>jQuery联系</title>
<script src='./jquery-1.9.1.min.js'></script>
</head>
<body>
<div id='d2'>
<input type='file'>
<input type='button' value='添加' class='but'>
</div>
</body>
<script>
$(function(){
$('.but').click(function(){
$('div:first').clone(true).insertAfter('div:last').append("<input type='button' value='删除' class='del'>");
$('.del').click(function(){
$(this).parent().remove();
})
})
})
</script>
</html>
- juery实现多行添加,
- juery 实现表单验证
- juery实现粘贴复制
- juery 动态添加 Table块
- juery
- juery实现ul li标签切换
- 关于用juery来隐藏标签以及添加样式等
- juery 飘窗制作,实现某一图片热点点击功能
- 用juery 实现的select特效 jquery.easydropdown.min.js
- Juery实现隔行变色与传统js对比
- juery实现alert弹框2s自动关闭
- juery同时判断多个输入框是否为空
- juery插件
- juery 选择器
- juery 循环
- Juery学习
- Juery.Form
- Juery实现的小案例1、实现复选框的全选、全不选以及反选
- jstl 几个基本使用
- 杂记
- Topic笔记:reinforcement learning
- Netfilter框架通过hook捕获数据包
- (4.3.2.15)Android——将图片加入到系统相册里面
- juery实现多行添加,
- 句子逆序,单词不逆序
- 一分钟快速搭建Windows防污染DNS服务器——Pcap_DNSProxy
- Js、事件的分类和介绍
- myeclipse快捷键
- BLE 数据包重传机制
- Windows系统 下载并安装 Notepad++ 图文教程
- 《汇编语言》学习(六)多个段的程序
- Android使用ItemTouchHelper实现RecyclerView的item拖动位置交换