Skip to content

Instantly share code, notes, and snippets.

@danheberden
Created April 1, 2011 17:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danheberden/898530 to your computer and use it in GitHub Desktop.
Save danheberden/898530 to your computer and use it in GitHub Desktop.
A selector engine
var Quewery = function( selector ) {
if( selector.match(/#[^\s]+$/) ) {
return [ document.getElementById( selector.substring(1) ) ];
} else {
return document.querySelectorAll( selector );
}
}
@mathiasbynens
Copy link

Quewery now has its own repo: https://github.com/danheberden/Quewery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment