Skip to content

Instantly share code, notes, and snippets.

@suryagaddipati
Created August 8, 2010 18:31
Show Gist options
  • Save suryagaddipati/514387 to your computer and use it in GitHub Desktop.
Save suryagaddipati/514387 to your computer and use it in GitHub Desktop.
jQuery.extend(jQuery.expr[':'], {
classStartsWith: function(a, i, m){
var classes = $(a).attr("className").split(" ")
var found = false;
for (var i = 0; i < classes.length; i++) {
if (classes[i].startsWith(m[3])) {
found = true;
break;
}
}
return found;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment