Created
April 26, 2012 21:58
-
-
Save stefanocudini/2503523 to your computer and use it in GitHub Desktop.
jquery :contains() case insensitive selector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.extend($.expr[':'], { //definizione di :conaints() case insesitive | |
| 'containsi': function(elem, i, match, array) | |
| { | |
| return (elem.textContent || elem.innerText || '').toLowerCase() | |
| .indexOf((match[3] || "").toLowerCase()) >= 0; | |
| } | |
| }); | |
| //example | |
| $("a:containsi('text')"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment