div move one div to another div get parent id javascript code example
Example: 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]);
}