当前位置: 代码迷 >> JavaScript >> this.oDiv.children.length在ff下该如何写
  详细解决方案

this.oDiv.children.length在ff下该如何写

热度:303   发布时间:2012-03-30 17:32:09.0
this.oDiv.children.length在ff下该怎么写
ie下能正常

------解决方案--------------------
<table>
<tr id= "oDiv " name= "oDiv "> <td> </td> <td> </td> </tr>
</table>
<script>
//alert(this.oDiv);
//this.oDiv--> undefined in firefox
alert(document.all?this.oDiv.children.length:document.getElementById( "oDiv ").childNodes.length);
</script>
  相关解决方案