Skip to content

Instantly share code, notes, and snippets.

@julesbou
Last active May 8, 2016 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julesbou/df33725bd7a23028b13a339af163ef7d to your computer and use it in GitHub Desktop.
Save julesbou/df33725bd7a23028b13a339af163ef7d to your computer and use it in GitHub Desktop.
window.$ = document.querySelector.bind(document)
window.$$ = document.querySelectorAll.bind(document)
HTMLElement.prototype.$ = HTMLElement.prototype.querySelector
HTMLElement.prototype.$$ = HTMLElement.prototype.querySelectorAll
// usage: $('.select-on-element')
// usage: $$('.select-a-list-of-element')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment