Skip to content

Instantly share code, notes, and snippets.

@arextar
Created September 6, 2011 23:23
Show Gist options
  • Save arextar/1199288 to your computer and use it in GitHub Desktop.
Save arextar/1199288 to your computer and use it in GitHub Desktop.
small selector testing function (would like to get it down to 140 bytes)
function is(a,b,c,d){
b=(!(c=(d=b.split(".")).shift().split("#"))[0]||a.nodeName==c[0].toUpperCase())&&
(!c[1]||a.id==c[1])
for(c=d.length;b=b&&~(' '+a.className+' ').indexOf(' '+d[--c]+' '););
return b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment