title: jQuery - move an element to another location in the html
body: <p>How can I move the <code>DIV</code>s with class <code>collapse</code> to another location with jQuery? I want to move them from inside the <code>TD</code>s to right after the <code>TR</code>s.</p>
  
  <p>I want to change the following:</p>
  
  <pre><code>&lt;tbody&gt;
      &lt;tr class=""&gt;
          &lt;td class="rozwin"&gt;
              &lt;div class="collapse" id="collapseExample-2"&gt; // original setting div
              &lt;/div&gt;
          &lt;/td&gt;
          &lt;td class="mrkPoradaLp"&gt;2&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr class=""&gt;
          &lt;td class="rozwin"&gt;
              &lt;div class="collapse" id="collapseExample-1"&gt;  // original setting div
              &lt;/div&gt;
          &lt;/td&gt;
          &lt;td class="mrkPoradaLp"&gt;3&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>&lt;tbody&gt;
      &lt;tr class=""&gt;
          &lt;td class="rozwin"&gt;&lt;/td&gt;
          &lt;td class="mrkPoradaLp"&gt;2&lt;/td&gt;
      &lt;/tr&gt;
      &lt;div class="collapse" id="collapseExample-2"&gt; // move to this location
      &lt;/div&gt;
  
      &lt;tr class=""&gt;
          &lt;td class="rozwin"&gt;&lt;/td&gt;
          &lt;td class="mrkPoradaLp"&gt;3&lt;/td&gt;
      &lt;/tr&gt;
      &lt;div class="collapse" id="collapseExample-1"&gt;  // move to this location
      &lt;/div&gt;
  &lt;/tbody&gt;
  </code></pre>