i have a 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 i want to use jquery to remove the row that contains specific data-r data.
any ideas?
$('#product-table tr').attr('data-r')will return thedata-rvalue of the first selected element.You want to search for an element with this attribute, which you can do with the attribute selector [docs]:
jQuery has very good documentation. All selectors are listed here.