Skip to content

Instantly share code, notes, and snippets.

@chrisma
Created June 15, 2015 09:55
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 chrisma/1ca5f1ba4342589de085 to your computer and use it in GitHub Desktop.
Save chrisma/1ca5f1ba4342589de085 to your computer and use it in GitHub Desktop.
JQuery's '$' selector syntax without the rest of JQuery..
function $(q, parent) {
parent = parent || document;
//convert DOM NodeList into array, so that e.g. 'forEach' can be called.
return Array.prototype.slice.call(parent.querySelectorAll(q));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment