Created
December 8, 2015 14:19
-
-
Save juanbrujo/464f9d83af01645d32dd to your computer and use it in GitHub Desktop.
Revisions
-
juanbrujo created this gist
Dec 8, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ // Shortcut to get elements var $ = function(element) { if (element.charAt(0) === "#") { // If passed an ID... return document.querySelector(element); // ... returns single element } return document.querySelectorAll(element); // Otherwise, returns a nodelist };