复制代码代码如下::
<! DocType html public "-// w3c // dtd html 4.01 transitional // en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<kopf>
<meta http-äquiv = "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);
für (var i = 0; i <value; i ++) {
var input = document.createelement ("Eingabe");
input.setAttribute ("Typ", "Text");
var br = document.createelement ("br");
document.getElementById ("div1"). appendChild (Eingabe);
document.getElementById ("div1"). appendChild (BR);
}
}
</script>
</head>
<body>
<Eingabe type = "text" id = "itemsNumber">
<input type = "button" id = "btn" value = "klicken" onclick = "addItems ();" >
<div id = "div1"> </div>
</body>
</html>