i’ve got a table and i’d like to hide rows that got a td within it with a value les then 100.
e.g. my table looks like
<table>
<tr><td>key</td><td>value</td></tr>
<tr><td>key1</td><td>30</td></tr>
<tr><td>key2</td><td>60</td></tr>
<tr><td>key3</td><td>90</td></tr>
<tr><td>key4</td><td>200</td></tr>
</table>
so in this example the first 3 rows should be hided.
I’m doing this with the :contains with non-numeric values but i not sure it is possible to do it with numbers.
And other option i thought about is giving the td’s an attribute with the value of the td and hide them depended on the value of the attribute.
something like
$('tr td[attr>"100"']).hide();
but im not sure that is the best way to scritp it since im new to jquery
Thanks for your input!
I’d suggest:
JS Fiddle demo.
References:
closest().hide().:last-childselector.parseInt().text().