js code
//添加一个div,并在div放开计划的控件
function AddDiv()
{
var parentDiv=document.getElementById('parentDiv');
var childDiv=document.createElement("div");
var j=parentDiv.children.length+1;
childDiv.id="div"+i;//childDiv.id="div"+parseInt(100 * Math.random());
childDiv.innerHTML="<table class='tableFrame1' width='100%' style='text-align:center;'>"+
"<tr><td><input id='btnDel' type='button' value='删除' οnclick='DeleteDiv(this)' style='width:98%;' /></td>"+
"<td style='width:7%;'><input type='text' name='remark' style='width:98%;' οnblur=/"this.value=this.value.replace(/,/g,',')/"/></td></tr></table>";
parentDiv.appendChild(childDiv);
}
//删除div
function DeleteDiv(input)
{
var div=input.parentElement.parentElement.parentElement.parentElement.parentElement;
div.parentNode.removeChild(div);
}
html code
<input type="button" value="button" οnclick="AddDiv()" />
<div id="parentDiv" style="width:100%;"></div>
C#取值的方法
string strRemark = Request.Form["remark"];
string[] strRemarks = strRemark.Split(',');