:contains - exact match and case insensitive
I'm using this function to make the :contains selector case insensitive and it works great.
$.expr[':'].icontains = function(obj, index, meta, stack){
return (obj.textContent || obj.innerText || jQuery(obj).text() || '').toLowerCase().indexOf(meta[3].toLowerCase()) >= 0;
};
Is there any way to combine the exact match function with case insensitive function that I'm using?
$.expr[":"].econtains = function(obj, index, meta, stack){
return (obj.textContent || obj.innerText || $(obj).text() || "").toLowerCase() == meta[3].toLowerCase();
}
I pulled both of the functions from this page: http://api.jquery.com/contains-selector/