Node.replaceChild()
Use this method to replace an existing child old with a new child new under a parent node N:
old
new
N
N.replaceChild(new, old)