日期:2014-05-16  浏览次数:20325 次

怎么使getElementsByTagName能获取iframe中的控件
直接用document.getElementsByTagName,没获取到iframe里的控件

网上看有人说遍历frame用 document.getElementByID('frame的id').document.xxx
发现frame的 .document的值是null,还有别的办法能取到吗?

------解决方案--------------------
 return document.getElementById(id).contentDocument 
------解决方案--------------------
 document.frames[id].document;