title: JavaScript DOM: transfer element between frames
body: <p>I'm using the following jQuery code within an iframe (same origin) to try to move a node from the iframe to the main (top) document.</p>
  
  <pre><code>var dest = $(window.top.document).find('#dest_id');
  dest.append($('#source_id'));
  </code></pre>
  
  <p>The following works ok:</p>
  
  <pre><code>window.top.document.getElementById('dest_id').innerHTML = document.getElementById('source_id').innerHTML;
  </code></pre>
  
  <p>I guess there is a limitation in moving DOM nodes between frames.
  Is there any way around this either in plain js or in jquery?</p>
  
  <p>Edit:
  Could it be something to do with the <code>ownerDocument</code> property?  I tried changing it to <code>window.top.document</code> on #dest_id but it didn't work.</p>
  
  <p>Edit, similar question: <a href="https://stackoverflow.com/questions/2284356/">Can&#39;t appendChild to a node created from another frame</a></p>