ノードを挿入する

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript"><!--
function controlTag()
{
divObj = document.createElement("div");
divObj.innerHTML = (new Date()).getTime()+"<br>";
$("result").insertBefore(divObj, $("result").childNodes[0]);
}
// --></script>
</head>
<body id="body">
<h1>XML/HTMLデータ処理</h1>
<form>
<input type="button" value="挿入" onClick="controlTag()">
</form>
<div id="result">この前に挿入されます。</div>
</body>
</html>
・サンプル1を実行する
・サンプル2を実行する
・サンプル3を実行する
Ajax逆引きクイックリファレンス 説明などは本書を参考にしてください。