can you append the child without appending the body of the document. code example
Example: appendchild on specific position
parentElement.insertBefore(newElement, parentElement.children[2]);
parentElement.insertBefore(newElement, parentElement.children[2]);