赞
踩
1, 动态表格的创建, 在输入框中输入内容后,点击保存则在表格末尾添加一条记录, 点击删除则会删除对应行的记录
<body>
<input type="text" placeholder="ID值">
<input type="text" placeholder="姓名">
<input type="text" placeholder="电话">
<button οnclick="save()">保存</button>
<table border="1px" id="tableBox">
<tr>
<th>id</th>
<th>name</th>
<th>Tel</th>
<th>操作</th>
</tr>
</table>
<script>
function save(){
var inps = document.getElementsByTagName('input')
var tr = document.createElement('tr') //创建td
fo
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。