add child node to body at the top code example Example: appendchild on specific position parentElement.insertBefore(newElement, parentElement.children[2]);