<!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>

#myDiv{
	width:100px;
	height:50px;
	background-color:#ccc;
	}

</style>
<script>

</script>

</head>

<body>
<input type="text" id="text01" name="what"  style="width:100px"/>
<input type="text" id="text02" name="where"/>
<input type="button" id='B' name="plus" value="添加" onclick="plus()"/>
<hr>
<div id=myDiv ><p></p></div>



<script type="text/javaScript">
function plus() {
		var newdiv1 = document.createElement("div"); 	//创建div
		newdiv1.style.width = "50";        // 设置宽度
         newdiv1.style.height ="10";
		var textnode = text01.value+"\n";
		newdiv1.innerHTML = textnode;	//给新div添加内容text01
		//newdiv1.style.width=100+"px";
		document.getElementById("myDiv").appendChild(newdiv1);	//把div插入到最后
	
		
		var newdiv2 = document.createElement("div"); 
		newdiv2.style.width = "50";        // 设置宽度
         newdiv2.style.height ="10";
		var textnode = text02.value+"\n";
		newdiv2.innerHTML = textnode;
		newdiv1.appendChild(newdiv2);
		
}
</script>


</body>
</html>