title: Move an applet without reloading it
body: <p>I want to move an applet from a <code>div</code> element to another <code>div</code> element without reloading it. I don't want to use absolute positioning. Is there a way to do this ?</p>
  
  <p>I try this but it's not working:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;script type="text/javascript"&gt;
          function toDiv1() {
              var appletElt = document.getElementById('myApplet');
              document.getElementById('div1').appendChild(appletElt);
          }
  
          function toDiv2() {
              var appletElt = document.getElementById('myApplet');
              document.getElementById('div2').appendChild(appletElt);
          }
      &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id ="myApplet"&gt;
              &lt;applet width="200" height="200" 
                  codebase="http://mainline.brynmawr.edu/Courses/cs110/spring2002/Applets/Smiley/"
                  code="Smiley.class"
                  name="Smiley"&gt;
              &lt;/applet&gt;
          &lt;/div&gt;
          &lt;div id="div1"&gt;&lt;/div&gt;
          &lt;div id="div2"&gt;&lt;/div&gt;
          &lt;div&gt;
              &lt;button onclick="toDiv1()"&gt;toDiv1&lt;/button&gt;
              &lt;button onclick="toDiv2()"&gt;toDiv2&lt;/button&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>You can try your answer on this <a href="http://fiddle.jshell.net/gontard/JRZXF/" rel="nofollow">fiddle</a></p>
  
  <hr>
  
  <p>The solution proposed by @goldenparrot with <code>outerHTML</code> works but not on all the browser (at least Firefox ESR). </p>
  
  <p>As stated in the @kritzikratzi answer and in the @biziclop answer, there are known problems on firefox with the reloading of iframe, flash object, plugin in firefox.</p>
  
  <p>I think (but i am not sure) that the sole solution is to use absolute positionning (@cuzzea). However, i asked this question because i wanted to find another way ("I don't want to use absolute positioning"). This is why i will award no answer. </p>
  
  <p>Thanks for your contributions.</p>