<html>
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html charset=utf8"/>
<script type="text/javascript">
//删除方法
function remove(obj){
obj.parentNode.parentNode.remove()
}
//添加方法
function add(){
var table = document.getElementById("table")
table.innerHTML = table.innerHTML + "<tr><td>xh001</td><td>王小明</td><td><a href='javascript:' onClick='remove(this)' >删除</a></td> </tr>"
}
</script>
</head>
<body>
<table border="1" width="50%" id="table">
<tr>
<th>学号</th>
<th>姓名</th>
<th>操作</th>
</tr>
<tr>
<td>xh001</td>
<td>王小明</td>
<td><a href="javascript:" onClick="remove(this)" >删除</a></td>
</tr>
<tr>
<td>xh002</td>
<td>刘小芳</td>
<td><a href="javascript:" onClick="remove(this)">删除</a></td>
</tr>
</table>
<input type="button" value="添加一行" onClick="add()" />
</html>
应该这样:
$info$doc = "<a href='delete.php?bh=" . $info['id'] . "'>del</a>"
欢迎分享,转载请注明来源:优选云