<html>
<head>
<script src="jquery-1.11.2.min.js"></script>
<script>
function clearLine(element){
$(element).parent().parent().remove();//使用jQuery方法
}
</script>
</head>
<body>
<table>
<tr>
<td><button onclick="clearLine(this)">点我,我就带着一行都没了</button></td>
<td>呵,我不信</td>
</tr>
<tr>
<td><button onclick="clearLine(this)">有本事再点我</button></td>
<td>哇,没法玩了</td>
</tr>
</table>
</body>
</html>
获取table当前点击的行数
最新推荐文章于 2022-12-31 16:55:00 发布