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

c# - Move local mssql database to webhosted MYSQL -

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

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -