0

I am using following code to test two table column values. only issue is how to convert .colNameivr values to upper case before matching with itemNames.

jQuery('.colNametns').each(function(i) { var itemName = jQuery(this).text().toUpperCase(); //1 var match = jQuery('.colNameivr:contains("' + itemName + '")'); //2 if(!match.length){ jQuery(this).toggleClass('red'); counter = i; } if(match.length){ alert(i+"--"+itemName ); callme1(itemName); } }); 

example here - http://jsfiddle.net/w7akB/53/
in above example -countryCode should not highlight as string is same.

1
  • 1
    Refer to this Commented Jul 31, 2012 at 16:07

1 Answer 1

4
jQuery.expr.filters.icontains = function(elem, i, m) { return (elem.innerText || elem.textContent || "").toLowerCase().indexOf(m[3].toLowerCase()) > -1; } $("div:icontains('text')") 

http://jsfiddle.net/SXsbP/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.