相关疑难解决方法(0)

IE中的getElementById.contentDocument错误

<html>
   <script type="text/javascript">
      function func() {
         alert(document.getElementById('iView').contentDocument);
      }    
   </script>
   <body>
      <iframe id="iView" style="width:200px;height:200px;"></iframe>
      <a href="#" onclick="func();">click</a>
   </body>
</html>
Run Code Online (Sandbox Code Playgroud)

点击后,Firefox返回[object HTMLDocument].Internet Explorer返回undefined.

如何使用Internet Explorer选择iView元素?谢谢.

javascript explorer getelementbyid

18
推荐指数
2
解决办法
2万
查看次数

标签 统计

explorer ×1

getelementbyid ×1

javascript ×1