Example 1:
<SCRIPT type = "text/JavaScript">
VaR T = 1;
Function AddFile ()
{
VaR parent = Document. getelementbyid ("more ");
VaR BR = Document. createelement ("Br ");
VaR input = Document. createelement ("input ");
VaR button = Document. createelement ("input ");
Input. type = "file ";
Input. Name = "uploadfile [" + (T ++) + "]. File ";
Input. size = "30 ";
Button. type = "button ";
Button. value = "delete ";
Button. onclick = function ()
{
Parent. removechild (BR );
Parent. removechild (input );
Parent. removechild (button );
};
Parent. appendchild (BR );
Parent. appendchild (input );
Parent. appendchild (button );
}
</SCRIPT>
Example 2:
Automatically add row JS:
Function addonelineonclick (){
VaR ROW = tblflowcarddetail. insertrow (tblflowcarddetail. Rows. Length );
VaR Col = row. insertcell (0 );
Col. innerhtml = "<input readonly = \" True \ "maxlength = 6 size = 6 name = aimid> <input type = button value =... name = btnselectaimclient Index = \ "" + rowindex + "\" onclick = \ "selectaimclient (this. index) \ "> ";
Col = row. insertcell (1 );
Col. innerhtml = "<tr> <input id = aimname name = aimname size = 25 maxlength = 25 readonly = \" True \ "> ";
Col = row. insertcell (2 );
Col. innerhtml = "<input readonly = \" True \ "maxlength = 6 size = 6 name = itemno> <input type = button value =... name = btnselectitem Index = \ "" + rowindex + "\" onclick = \ "selectitem (this. index) \ "> ";
Col = row. insertcell (3 );
Col. innerhtml = "<input id = itemname name = itemname size = 25 maxlength = 25 readonly = \" True \ "> ";
Col = row. insertcell (4 );
Col. innerhtml = "<input id = spec name = spec size = 10 maxlength = 10 readonly = \" True \ "> ";
Col = row. insertcell (5 );
Col. innerhtml = "<input id = pattern name = pattern size = 10 maxlength = 10 readonly = \" True \ "> ";
Col = row. insertcell (6 );
Col. innerhtml = "<input id = unit name = unit size = 4 maxlength = 4 readonly = \" True \ "> ";
Col = row. insertcell (7 );
Col. innerhtml = "<input id = qty name = qty size = 6 maxlength = 6> ";
Col = row. insertcell (8 );
Col. innerhtml = "<input type = 'button 'value = 'delete' id = btndeleteline name = btndeleteline onclick = \" Return deleterow ('row "+ rowindex + "') \ "> </tr> ";
Rowindex ++;
}