Remove table row using jQuery

前端 未结 6 1693
别跟我提以往
别跟我提以往 2021-02-19 03:57

The following is my code

Script

$(document).ready(function(){
    $(\'#click\').click(function(){
        $(\'#table\').append(\'&a         


        
6条回答
  •  遥遥无期
    2021-02-19 04:35

    If You want to remove row itself when click on table row then

    $('table tr').on("click", function(){
        $(this).remove();
    });
    

    If you want to add row on click of click button at the end of table

     $('#click').click(function(){
        $('#table').append('Xyz');
    })
    

提交回复
热议问题