动态向td中添加文本框


//添加模块
function addRow()
{ 	
//获取TABLE的ID
var voteOptionTable = document.getElementById("stream");
//获取TABLE中的<tbody></tbody> 标签ID
var tbody = voteOptionTable.getElementsByTagName("tbody")[1];
//获取<tbody>标签中的<tr>标签
var columnOrder = tbody.getElementsByTagName("tr").length + 1;
//获取<tbody>中的第一个<tr>
var tr = tbody.getElementsByTagName("tr")[0];
var trClone =  tr.cloneNode(true);
trClone.getElementsByTagName("td")[0].innerHTML ='<input cssStyle="width:100%" name="projectapplyinfo.billNo" />' ;

trClone.getElementsByTagName("td")[1].innerHTML ='<input cssStyle="width:100%" name="projectapplyinfo.projectId"  />';

trClone.getElementsByTagName("td")[2].innerHTML ='<input cssStyle="width:100%" name="projectapplyinfo.moduleId"  />';

trClone.getElementsByTagName("td")[3].innerHTML ='<input cssStyle="width:100%" name="projectapplyinfo.applyContent" />';

trClone.getElementsByTagName("td")[4].innerHTML ='<input cssStyle="width:100%" name="projectapplyinfo.mainEmployee" />';

trClone.getElementsByTagName("td")[5].innerHTML ='<input cssStyle="width:100%" name="projectapplyinfo.cooperateeMployee" />';

trClone.getElementsByTagName("td")[6].innerHTML ='<input cssStyle="width:100%" name="projectapplyinfo.ensurEemployee" />';

trClone.getElementsByTagName("td")[7].innerHTML ='<input cssStyle="width:100%" name="projectapplyinfo.content" />';

tbody.appendChild(trClone);
}

你可能感兴趣的:(文本框)