jquery - removing row with specific data-r -
jquery - removing row with specific data-r -
i have simple table:
<table id="product-table"> <tr data-r="12"> <td>one</td> <td>two</td> </tr> <tr data-r="34"> <td>three</td> <td>four</td> </tr> </table> and want utilize jquery remove row contains specific data-r data.
any ideas?
$('#product-table tr').attr('data-r') homecoming data-r value of first selected element.
you want search element attribute, can attribute selector [docs]:
var value = 12; $('#product-table tr[data-r="' + value + '"]').remove(); jquery has documentation. selectors listed here.
jquery row
Comments
Post a Comment