table 删除 某一个 tr

<tr>
     <td><input type='button' size=5 value='删除' οnclick="deleteCurrentRow(this)" />
     </td>
</tr>
 
 
 
function deleteCurrentRow(obj){
        var tr=obj.parentNode.parentNode;
        var tbody=tr.parentNode;
        if(tbody.rows.length<=1){
            closeSpec();
            return ;
        }
        tbody.removeChild(tr);
}
 

转载至: https://blog.csdn.net/hf312350968/article/details/84300816

posted @ 2021-07-09 18:21  Black_Climber  阅读(236)  评论(0编辑  收藏  举报