/ Published in: jQuery
This one was not created by me, but I can't remember who originally created it. It does the same thing as the built in <code>:contains()</code> selector with one important difference, it's case insensitive. Since I usually type in all lower case (bad habit I know) I like to use it for filters. It's also a nice one to use on name filters, that way if the person using the filter doesn't use the proper case it will still pull of the name, for example if they type in "Delsoto", but the proper capitalization is "DelSoto" the default <code>:contains()</code> won't find it, but this modified <code>:Contains()</code> will. Very convient.
If you have any questions about this selector, or happen to know who made tit, post and let me know. Use it in a cool project, do the same.
If you have any questions about this selector, or happen to know who made tit, post and let me know. Use it in a cool project, do the same.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jQuery.expr[':'].Contains = function(a,i,m){ return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0; };
URL: http://fatfolderdesign.com/259/code/couple-of-jquery-selectors