목차

테이블 행(TR) 삭제하기

  • description :
  • author : 주레피
  • email : dhan@repia.com
  • lastupdate : 2020-01-31

코드 예시

<script>
function deleteLine(obj)
 {
    var tr = $(obj).parent().parent();
    //라인 삭제
    tr.remove();
}
</script>
 
<table border="1">
    <tr>
        <td>Hello Brother! 1번</td>
        <td><button onclick="deleteLine(this);">삭제</button></td>
    </tr>
    <tr>
        <td>Hello Brother! 2번</td>
        <td><button onclick="deleteLine(this);">삭제</button></td>
    </tr>
</table>

Ref