Moving nodes

Test elements

This is element x.
This is element y.
This is element z. It has an onclick attribute.

Test scripts

Test clone = z.cloneNode(true)
Test clone = z.cloneNode(false)
Append clone to

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.