9951 explained code solutions for 126 technologies


javascriptHow to move an element into another element


document.querySelector('#parent').appendChild( document.querySelector('#child') );ctrl + c
document.querySelector('#child')

selects element to append to new element

document.querySelector('#parent')

selects element to append child element to

appendChild

appends element in arguments to selected element