Cloning nodes from an iframe

Atom RSS

This site heavily relies on bug reports created by its readers. Anyone can report a bug and be published.

Main navigation:

Search reports by browser:

It is impossible to clone nodes in an iframe and append these clones to a node in the main page. Copying innerHTML works fine, though.

Test page. Workaround is not included.
Reported by Jaap Roes.

(Orphaned), Explorer 5-6 Windows, Explorer Mac, Opera | Reported on 21 November 2004.


(Add your own)

Posted by Sebastian Redl on 24 November 2004


This is not really a bug. cloneNode does not change the owning document, which is, even for the clones, the iframe's document. It is therefore illegal and should throw a DOMException with this error code:
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.

Seen this way, it is Mozilla who has the bug by being too lenient.

However, IE has a real bug in that it doesn't support Document.importNode, which would be the proper way to do this.

Posted by Mark Wubben on 24 November 2004


I wrote a workaround for this some time ago:

Posted by Alex on 16 February 2005


The cloneNode method will not work on an IFRAME directly. You must call it through the all collection.

Have you tried using: var data =;

Please see the following link for more information.

Post a comment

Commenting guidelines:

  1. When quoting specs, articles or your own research, please include a URL of the document.
  2. Test your stuff. When reporting browser behaviour, make sure that your report is correct.