Answers for "move dom element to another parent"

0

move dom element to another parent

const newParent = document.getElementById('new-parent');
const oldParent = document.getElementById('old-parent');

while (oldParent.childNodes.length > 0) {
    newParent.appendChild(oldParent.childNodes[0]);
}
Posted by: Guest on December-02-2020

Code answers related to "move dom element to another parent"

Code answers related to "Javascript"

Browse Popular Code Answers by Language