Created
April 7, 2014 03:11
-
-
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.
This file contains hidden or 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 $$ = 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved, the fx has to be defined before it's used.