jquery delete table row

后端 未结 5 1549
后悔当初
后悔当初 2021-01-31 18:57

I have a table

5条回答
  •  再見小時候
    2021-01-31 19:09

    Here is another option.

    function DeleteRowOfProductTable(productID){
        $('#YourTableId tr').each(function (i, row) {
            var $row = $(row);
            var productLabelId =  $row.find('label[name*="Product_' + productID + '"]');
    
           var $productLabelIdValue = $productLabelId.text();
           if (parseInt(productID) == parseInt($productLabelIdValue))
           {
               $row.remove(); 
           }
        });
     }
    

提交回复
热议问题
Food Name: Restaurant Name: