Reputation: 1805
$("table[id=" + tblName + "] tr").not(":contains('" + val + "')").hide();
This code will hide all TR
s not containing "val".
I have "val1" and "val2" in my code. I wish to hide TR
s not containing both "val1" and "val2"
How do I do that?
^>^ Thanks for your help.
Upvotes: 1
Views: 1783
Reputation: 78520
Logically an AND exclusion:
$("table[id=" + tblName + "] tr").not(":contains('" + val1 + "'):contains('" + val2 + "')").hide()
Logically an OR exclusion:
$("table[id=" + tblName + "] tr").not(":contains('" + val + "')").not(":contains('" + val2 + "')").hide();
Upvotes: 6