I'm looking to extract an element from the DOM tree of an iframe and transfer it to the DOM tree of the parent document.
Although this process is successful with most modern browsers, it encounters an issue with IE7, generating an Error: Invalid argument.
Test scenario
ie7test.html
<html>
<head></head>
<body>
<div id="containerrrr">
<iframe id="iframe_element" src="ie7testiframe.html"></iframe>
</div>
</body>
</html>
ie7testiframe.html:
<html>
<head></head>
<body>
<div id="target_element">target</div>
<script type="text/javascript">
var iframe_element = window.parent.document.getElementById("iframe_element");
var target_element = window.document.getElementById("target_element");
iframe_element.parentNode.insertBefore(target_element, iframe_element);
</script>
</body>
</html>