Test clone = z.cloneNode(true) Test clone = z.cloneNode(false) Append clone to choose: x y z Test x.appendChild(y) Test y.insertBefore(x,z) Test y.removeChild(z) Test y.replaceChild(x,z)
It's best to reload the page between tests.