Skip to content

Instantly share code, notes, and snippets.

@arextar arextar/is.js
Created Sep 6, 2011

Embed
What would you like to do?
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
You can’t perform that action at this time.