楼主我是来拿分的... 标准的DOM生成节点、插入.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
p{border:1px solid #000; margin:4px auto; width:100px; text-align:center}
</style>
</head>
<body>
<div id="outer"></div>
</body>
</html>
<script type="text/javascript">
function test(){
var outer=document.getElementById("outer");
for(var i=0;i<5;i++){
var p=document.createElement("p");
var txt=document.createTextNode("第"+i+"个p");
p.appendChild(txt);
outer.appendChild(p);
}
}
test();
</script>