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

如何使getElementsByTagName能获取iframe中的控件

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

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

网上看有人说遍历frame用 document.getElementByID('frame的id').document.xxx
发现frame的 .document的值是null,还有别的办法能取到吗?
[解决办法]
 return document.getElementById(id).contentDocument 
[解决办法]
 document.frames[id].document; 

热点排行