87,910
社区成员
发帖
与我相关
我的任务
分享
<script>
function addRow(){
var htmlData="";
var div = document.createElement('div');
div.style.color = 'red'; //这么加
var input = document.createElement('input');
input.type = 'text';
input.maxlength = '50';
input.name = 'tname';
input.onclick = function(){
alert('aaaaa');
};
div.appendChild(input);
document.getElementById('inputdetail').appendChild(div);
}
</script>
<div id="inputdetail"> </div>
<input type = button value = "addrow" onclick = "addRow()"/>
<script>
function addRow(){
var htmlData="";
var div = document.createElement('div');
var input = document.createElement('input');
input.type = 'text';
input.maxlength = '50';
input.name = 'tname';
input.onclick = function(){
alert('aaaaa');
};
div.appendChild(input);
document.getElementById('inputdetail').appendChild(div);
}
</script>
<div id="inputdetail"> </div>
<input type = button value = "addrow" onclick = "addRow()"/>
<script>
function addRow(){
var doms=document.getElementById('inputdetail');
var div=document.createElement("div");
var ipt=document.createElement("input");
ipt.type="text";
ipt.maxlength=50;
ipt.name="tname";
ipt.onclick=function(){
alert("click")
}
div.appendChild(ipt);
doms.appendChild(div);
}
</script>
<div id="inputdetail"> </div>
<input type = button value = "addrow" onclick = "addRow()">
function addRow() {
var div = document.createElement("div");
div.innerHTML = "<input type='text' maxlength='50' name='tname' />";
document.getElementById('inputdetail').appendChild(div);
}