<div class="codetitle"> <span><a style="CURSOR: pointer" data="46932" class="copybut" id="copybut46932" onclick="doCopy('code46932')"><u>复aze代码</u></a></span> 代码如下:</div> <div class="codebody" id="code46932"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 전환//EN" "http://www.w3.org/TR/html4/loose.dtd"> <br><html> <br><머리> <br><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <br><title>jquery2</title> <br><script type="text/javascript"> <br>//创建节点 <br>var addItems = function() { <br>document.getElementById("div1").innerHTML = ""; <br>var value = parsInt(document.getElementById('itemsNumber').value); <br>for (var i = 0; i < value; i ) { <BR>var input = document.createElement("input"); <BR>input.setAttribute("type", "text"); <BR>var br = document.createElement("br"); <BR>document.getElementById("div1").appendChild(입력); <BR>document.getElementById("div1").appendChild(br); <br><br>} <BR>} <BR></script> <br></head> <br><본문> <br><input type="text" id="itemsNumber"> <br><input type="button" id="btn" value="click" onclick="addItems();" > <br><div id="div1"></div> <br></body> <br></html> <br> </div>