<?xml version="1.0" encoding="GBK" ?>
<%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%>
<!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=GBK" />
<title>Insert title here</title>
<script src="<%=request.getContextPath()%>/scripts/prototype.js" type="text/javascript"></script>
<script type="text/javascript">
function deleteRow(obj){
//发送ajax请求删除制定id的数据
//根据返回标志确定是否要删除对应的行
alert($(obj).rowIndex);
$('mytable').deleteRow(0);
}
</script>
</head>
<body>
<table id="mytable" border="1">
<tbody>
<tr id="tr1">
<td>dddd</td>
<td>eeee</td>
<td width="200"><a href="javascript:deleteRow('tr1');" >删除</a></td>
</tr>
<tr id="tr2">
<td>dddd</td>
<td>eeee</td>
<td width="200"><a href="javascript:deleteRow('tr2');" >删除</a></td>
</tr>
<tr id="tr3">
<td>dddd</td>
<td>eeee</td>
<td width="200"><a href="javascript:deleteRow('tr3');" >删除</a></td>
</tr>
</tbody>
</table>
</body>
</html>
删除table行
最新推荐文章于 2018-09-22 16:12:57 发布