我有这样的事情:
<html>
<body>
<iframe id="someFrame"></iframe>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我想使用jQuery编写元素,以便完全等效的HTML将是这样的:
<html>
<body>
<iframe id="someFrame">
<!-- inside the iframe's content -->
<!-- <html><body> -->
<div>A</div>
<div>B</div>
<div>C</div>
<!-- </body></html> -->
</iframe>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
或者,任何普通的Javascript都可以.
谢谢.
编辑:经过一些研究,似乎我正在寻找一个IE等效的iframe的contentDocument属性."contentDocument"是FF支持的W3C标准,但IE不支持.(惊喜)