复制代码代码如下:
<! DocType html public "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<Evista>
<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 = "";
value var = parseInt (document.getElementById ('itemsnumber'). Value);
para (var i = 0; i <valor; i ++) {
var input = document.createElement ("entrada");
input.SetAttribute ("Tipo", "Texto");
var br = document.createElement ("br");
document.getElementById ("Div1"). AppendChild (entrada);
document.getElementById ("Div1"). AppendChild (BR);
}
}
</script>
</ablo>
<Body>
<input type = "text" id = "itemsnumber">
<input type = "button" id = "btn" value = "click" onclick = "addItems ();" >
<div id = "div1"> </div>
</body>
</html>