appendChild()

This is a P with ID="test"

This is a P inside a DIV. The DIV has a border and an ID="writeroot"

Append the test P to the DIV.

function append()
{
	document.getElementById('writeroot').appendChild(document.getElementById('test'));
}

Append a newly created HR to the DIV.

function append2()
{
	document.getElementById('writeroot').appendChild(document.createElement('hr'));
}