Skip to content

Instantly share code, notes, and snippets.

@MightyPork
Created August 22, 2017 12:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MightyPork/9b40f078dc3579af49a347e34fd9590b to your computer and use it in GitHub Desktop.
Save MightyPork/9b40f078dc3579af49a347e34fd9590b to your computer and use it in GitHub Desktop.
tiny inlineable query library to replace jquery
// uQuery
function qsa(q){return document.querySelectorAll(q)}
function qs(q){return document.querySelector(q)}
function bind(el,evt,fn){el.addEventListener(evt,fn)}
function qbind(q,evt,fn){var els=qsa(q);els&&els.forEach(function(el){el.addEventListener(evt, fn)})}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment