/ Published in: JavaScript

This will extend jquery to have a :Contains selector that is case insensitive, the :contains selector remains unchanged.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// For jQuery 1.2 jQuery.extend( jQuery.expr[':'], { Contains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" }); // For jQuery 1.3 (thanks @user95227) and later you need jQuery.expr[':'].Contains = function(a,i,m){ return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0; };
URL: http://stackoverflow.com/questions/187537/is-there-a-case-insensitive-jquery-contains-selector
Comments
