<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元素?谢谢.