Created
April 1, 2011 17:35
-
-
Save danheberden/898530 to your computer and use it in GitHub Desktop.
A selector engine
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
var Quewery = function( selector ) { | |
if( selector.match(/#[^\s]+$/) ) { | |
return [ document.getElementById( selector.substring(1) ) ]; | |
} else { | |
return document.querySelectorAll( selector ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quewery now has its own repo: https://github.com/danheberden/Quewery