Reputation: 1804
hi i was wondering if there is a way to use multiple strings in the jquery selector :contains()
. for example I would liek to do something like this:
$("#"+idArray[i]).find("th:Contains(" + query && query2 + ")").closest($(".instTable, .break")).show();
similar to an if statement's sysntax. is this possible?
thanks
Upvotes: 2
Views: 1314
Reputation: 339816
Sure, as you want an and
condition, that's just the same as filtering for both matches independently.
$(selector).find('th:contains(' + query1 +'):contains(' + query2 + ')') ...
Upvotes: 1