3

I would like to move the iframe from d1 to d2, without having its contents refreshed.

<div id="d1"> 
<iframe src="http://www.website.com/"></iframe>
<div id="d2"></div>
</div>

I have tried the getElementById() with appendChild() but it ends up deleting everything.

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
Meteor
  • 55
  • 1
  • 6
  • Even if you use `.innerHTML`, `.appendChild()`, or JQuery's [.before](http://api.jquery.com/before/) it'll add a new iframe instance and thus your contents would be removed. Nice question! I never thought of this and would like to see a solution. – Michael Schwartz Apr 23 '16 at 10:57
  • 1
    This might be of a help to you - http://stackoverflow.com/questions/8318264/how-to-move-an-iframe-in-the-dom-without-losing-its-state – Riken Shah Apr 23 '16 at 13:15

0 Answers0