javascript 代码
<script language="JavaScript">
var num = 0;
//insert a row
function addRow()
{
var dataBox = document.getElementById("dataBox");
var otr = dataBox.insertRow(dataBox.rows.length);
var otd = otr.insertCell();
otd.height = "25";
num = num + 1
var sHTML = "<input type='file' name='file"+num+"' SIZE='50'>"
otd.innerHTML = sHTML;
}
//delete a row
function delrow()
{
var i = 0,otr;
var dataBox = document.getElementById("databox");
i=num;
if(num!=0){
otr = dataBox.deleteRow(i);
num--;
}
}
</script>
html 代码
<table width="80%" id="dataBox" class="tblBillDetail" cellspacing="0" cellpadding="0" height="0" border="0">
<tr><td><input type='file' name='file0' SIZE='50'></td></tr>
</table>