tags:

views:

6733

answers:

1

I would like to move one DIV element inside another. For example, I want to move this (including all children):

<div id="ctl00_c1_vw_Module_SectionAssociation_pnl1" class="i-panel">
...
</div>

into this:

<div id="sectionassociation-i-panel" class="i-panel">
...
</div>

so that I have this:

<div id="sectionassociation-i-panel" class="i-panel">
  <div id="ctl00_c1_vw_Module_SectionAssociation_pnl1" class="i-panel">
    ...
  </div>
</div>
+17  A: 

You want to use the appendTo function:

$("#ctl00_c1_vw_Module_SectionAssociation_pnl1")
    .appendTo("#sectionassociation-i-panel");
Andrew Hare