Created
May 12, 2014 10:08
-
-
Save SteGriff/ac2acd90768f6d3cf07a to your computer and use it in GitHub Desktop.
Dumb sizzler
This file contains 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
function $(x){ | |
return ((x[0]=="#") ? document.getElementById(x.substr(1)) : document.getElementsByTagName(x)[0]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For when you want the convenience of jQuery's Sizzle selector but don't need its full power, and don't want the whole weight of the library behind it.$('#results') gets the element with id='results' and $ ('h1') gets the first h1 tag in the document.