<input type="text" id="inp1" />
<button onclick="SC_Input()">生成输入框</button>
<div id="input-container" style="margin-top:20px;padding-bottom:10px;">
</div>
function SC_Input(){
var obj =document.getElementById("inp1");
var count=obj.value;
var html_content="";
for(var i=0;i<count;i++){
html_content+="<input type='text' id='"+i+"' name='TT'/><br/>"
}
var obj1=document.getElementById("input-container");
obj1.innerHTML=html_content;
}
</script> |