复制代码代码如下 :
<! doctype html public "-// w3c // dtd html 4.01 Transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<헤드>
<meta http-equiv = "content-type"content = "text/html; charset = utf-8">
<title> jquery2 </title>
<script type = "text/javaScript">
// 创建节点
var additems = function () {
document.getElementById ( "div1"). innerHtml = "";
var value = parseint (document.getElementById ( 'itemsNumber'). value);
for (var i = 0; i <value; i ++) {
var input = document.createElement ( "입력");
input.setattribute ( "type", "text");
var br = document.createelement ( "br");
document.getElementById ( "div1"). AppendChild (입력);
document.getElementById ( "div1"). AppendChild (BR);
}
}
</스크립트>
</head>
<body>
<입력 유형 = "text"id = "itembernumber">
<input type = "button"id = "btn"value = "click"onclick = "additems ();"; >
<div id = "div1"> </div>
</body>
</html>