Firefox浏览器不能识别table.cells? [英] Does Firefox browser not recognize table.cells?
本文介绍了Firefox浏览器不能识别table.cells?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var myCellCollection = document。的getElementById( 'MYTBL')的细胞。
这个效果在IE中很好,的表格单元格。但是同一行在Firefox中返回undefined。我使用的是IE 9和Firefox 12。 ).getElementsByTagName('td');
I have the following JavaScript code.
var myCellCollection = document.getElementById('myTbl').cells;
This works well in IE and it returns a collection of table cells. But the same line returns "undefined" in Firefox. I am using IE 9 and Firefox 12.
解决方案
You should use document.getElementById("myTbl").getElementsByTagName('td')
;
这篇关于Firefox浏览器不能识别table.cells?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文