I would like to hide table rows after checking for accepted values in multiple columns.
The table would be:
<table id="my-table>
<tr><td class="name">John</td><td class="lastname">Doe</td></tr>
<tr><td class="name">Ann</td><td class="lastname">Doe</td></tr>
<tr><td class="name">John</td><td class="lastname">Smith</td></tr>
</table>
Based on my research so far (and this post), hiding all but John Doe would require the following Jquery phrase:
$("#my-table td.name:not(:contains('John')):td.lastname:not(:contains('Doe'))").parent().hide();
But Jquery doesn't like that and says Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: td
What's the right way to do this?
By the same token I'd like to understand how to make more complex queries such as:
Hide all rows with 'first name' containing 'a' OR 'b' AND 'last name' containing 'x' OR 'y'
.