Created
September 6, 2011 23:23
-
-
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)
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
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