I’m trying to do something like this:
<div id="aa">
<select><option>1</option></select>
<select><option>a</option></select>
</div>
<div id="bb"></div>
$('#aa').html(appendTo('#bb'));
How can I move the two select menus inside #aa to #bb?
Many thanks.
If you want to move them, and not copy them, do this:
If you do want to copy them, you can do this:
Both of these prevent you from needlessly destroying DOM elements, and they retain any event handlers on the elements.
EDIT: I was going the wrong direction. I had the children of
bbappended toaa. Fixed.