Skip to content

Instantly share code, notes, and snippets.

@danheberden
Created April 1, 2011 17:35
Show Gist options
  • 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