-
-
Save ryanmcgrath/1188164 to your computer and use it in GitHub Desktop.
Mobile friendly easy as pie $().
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
var $ = window.$ = function $(selector) { | |
if(/^#[a-zA-Z_\-]+$/.test(selector)) | |
return document.getElementById(selector.substr(1, selector.length)); | |
return Array.prototype.slice.call(document.querySelectorAll(selector)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment