Delete dynamically-generated table row using jQuery

前端 未结 6 2057
情深已故
情深已故 2020-12-31 02:28

the code below add and remove table row with the help of Jquery the add function works fine but the remove only work if I remove the first row

         


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-31 03:14

      $(document.body).on('click', 'buttontrash', function () { // <-- changes
        alert("aa");
       /$(this).closest('tr').remove();
        return false;
    });
    

    This works perfectly, take not of document.body

提交回复
热议问题