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

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -