动态地添加或或删除table里的行
<div id="fileDiv">
<table id="picTable"></table>
<a href="javascript:void(addPicFile('picTable'));"
class="file">添加图片</a>
*
</div>
<script type="text/javascript">
function addPicFile(idstr) {
currRow=document.getElementById(idstr).insertRow();
cellc=currRow.insertCell();
if(idstr=='picTable')
{
cellcContext= "<input type='file'id ='tt' NAME='file'> <button onclick="removePicFile(\'picTable\',this.parentNode.parentNode.rowIndex);">删除</button><br>";
}
cellc.innerHTML=cellcContext;
}
function removePicFile(idstr,rowIndex){
document.getElementById(idstr).deleteRow(rowIndex);
}
</script>