Skip to content

Instantly share code, notes, and snippets.

@z-------------
Created April 7, 2014 03:11
Show Gist options
  • Save z-------------/10014308 to your computer and use it in GitHub Desktop.
Save z-------------/10014308 to your computer and use it in GitHub Desktop.
Do $$(selector) instead of document.querySelector(selector). Just saves a lot of time.
var $$ = function(sel) {
return document.querySelector(sel);
}
var $$$ = function(sel) {
return document.querySelectorAll(sel);
}
// $$ is equivalent to querySelector
// $$$ is equivalent to querySelectorAll
// if you hadn't already figured that out
@johnaweiss
Copy link

Solved, the fx has to be defined before it's used.

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