W3C DOM tests - node manipulation

This is element x.
This is element y.
This is element z.

These tests are about manipulating the nodes in your document.

I advise you to reload this page between tests; executing some tests may preclude others from working.

Test scripts

appendChild()

x.appendChild(y)
x.appendChild(z)
y.appendChild(z)

cloneNode()

var test = y.cloneNode(true);
test.appendChild(document.createTextNode(' (cloned node)'));
x.appendChild(test);
var test = y.cloneNode(false);
test.appendChild(document.createTextNode(' (cloned node)'));
x.appendChild(test);

insertBefore()

y.insertBefore(x,z);

removeChild()

y.removeChild(z);

replaceChild()

y.replaceChild(x,z);