日期:2014-05-16 浏览次数:20385 次
<script src="js/jquery-ui-1.9.0.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
function a() {
var x = document.getElementsByTagName("td");
if (x.length == 0) {
alert("");
return false;
}
var y = x[0];
y.parentNode.removeChild(y);
alert(x.length);
}
</script>
<div>
<table>
<tr>
<td>
1
</td>
<td>
2
</td>
<td>
3
</td>
<td>
4
</td>
</tr>
</table>
<input type="button" onclick="a()" />
</div>