<div class="codetitle"> <span><a style="CURSOR: pointer" data="46932" class="copybut" id="copybut46932" onclick="doCopy('code46932')"><u>复制代</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 = parseInt(document.getElementById('itemsNumber').value); <br>for (var i = 0; i <value i>var input = document.createElement("input"); <br>input.setAttribute("タイプ", "テキスト"); <br>var br = document.createElement("br"); <br>document.getElementById("div1").appendChild(input); <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></value> </div>