<html>
<body>
<div id="x">this text should show up twice</div>
<div id="y"></div>
<div>this text should show up once</div>
<script language="JavaScript">
document.getElementById("y").innerHTML = document.getElementById("x").outerHTML;
</script>
</body>
</html>