Skip to content

Instantly share code, notes, and snippets.

@lbalceda
Created August 19, 2014 04:24
Show Gist options
  • Save lbalceda/9d137f236cf044d8456a to your computer and use it in GitHub Desktop.
Save lbalceda/9d137f236cf044d8456a to your computer and use it in GitHub Desktop.
jquery select matching text
$.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