复制代码代码如下:
<! Doctype html public "-// w3c // dtd html 4.01 transitório // pt" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<head>
<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 ('itensNumber'). valor);
for (var i = 0; i <valor; i ++) {
var input = document.createElement ("input");
input.SetAttribute ("Type", "Text");
var br = document.createElement ("Br");
document.getElementById ("div1"). AppendChild (entrada);
Document.getElementById ("Div1"). AppendChild (BR);
}
}
</script>
</head>
<Body>
<input type = "text" id = "itensNumber">
<input type = "button" id = "btn" value = "clique" onclick = "addItems ();" >
<div id = "div1"> </div>
</body>
</html>