下面的代码为什么在IE浏览器上能行,而在其他浏览器上不行呢
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"><html><head></head><body><ta...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<table id="tab" width="200" border=1>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
<script type="text/javascript">
var x =document.getElementById("tab").getElementsByTagName("tr");
x[0].lastChild.style.color="red";
var ta1=x[0].firstChild;
ta1.parentNode.removeChild(ta1);
</script>
</body>
</html> 展开
<html>
<head>
</head>
<body>
<table id="tab" width="200" border=1>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</table>
<script type="text/javascript">
var x =document.getElementById("tab").getElementsByTagName("tr");
x[0].lastChild.style.color="red";
var ta1=x[0].firstChild;
ta1.parentNode.removeChild(ta1);
</script>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询