“Cut and Paste” – moving nodes in the DOM with Javascript

In this case, document.getElementById('id1').appendChild(document.getElementById('id2')); should do the trick.

More generally you can use insertBefore().

Leave a Comment