LEDADBBS网友提供的一个动态增加/删除文件域的代码,还不错,收藏一下. function additem(id){ var row,cell,str; row = eval("document.all["+'"'+id+'"'+"]").insertRow(); if(row != null ){ cell = row.insertCell(); str="<input type="+'"'+"file"+'"'+" name="+'"'+"addfile"+'"'+"><input type="+'"'+"button"+'"'+" value="+'"'+"delete"+'"'+" onclick='deleteitem(this,"+'"'+"tb"+'"'+");'>" cell.innerHTML=str; } } function deleteitem(obj,id){ var rowNum,curRow; curRow = obj.parentNode.parentNode; rowNum = eval("document.all."+id).rows.length - 1; eval("document.all["+'"'+id+'"'+"]").deleteRow(curRow.rowIndex); } [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]