读书人

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

发布时间: 2012-03-30 17:32:09 作者: rapoo

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>

读书人网 >JavaScript

热点推荐