[HTML] 纯文本查看 复制代码
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>蚂蚁部落</title>
<script type="text/javascript">
window.onload=function() {
let otable=document.getElementById("thetable");
let obt=document.getElementById("bt");
obt.onclick=function(){
otable.deleteRow(2);
}
}
</script>
</head>
<body>
<table id="thetable" border="1">
<tr>
<td>序号</td>
<td>教程</td>
<td>作者</td>
</tr>
<tr>
<td>1</td>
<td>javascript教程</td>
<td>antzone</td>
</tr>
<tr>
<td>2</td>
<td>div css教程</td>
<td>蚂蚁部落</td>
</tr>
</table>
<input type="button" id="bt" value="点击删除指定行"/>
</body>
</html>