Created
August 19, 2014 04:24
-
-
Save lbalceda/9d137f236cf044d8456a to your computer and use it in GitHub Desktop.
jquery select matching text
This file contains 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
$.expr[':'].textEquals = function(a, i, m) { | |
var match = $(a).text().match("^" + m[3] + "$") | |
return match && match.length > 0; | |
} | |
//usage: | |
$("a:textEquals('Click Me!')"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment