I'm using jQuery contains to show records in a page that contains information that matches a search field. This functions works very well, a bit too good actually...
The challenge is that it also searches for matching words in SELECT elements that is inside the table column.
$(this).find('td:nth-child(2)').each(function () {
if ($(this).is(':contains(' + fValue + ')')) {
$(this).closest('tr').show();
bFound = true;
} else {
$(this).closest('tr').hide();
}
});
I have tried multiple methods to achieve the goal, but no still no luck…
if ($(this).is(':contains(' + fValue + ')').not('select')) { //error
if ($(this).is(':contains(' + fValue + '):not(select)')) { //same result as without the not