首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2012-03-30 
this.oDiv.children.length在ff下该怎么写ie下能正常[解决办法] tabletrid oDiv name oDiv td

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>

热点排行