Skip to content

Instantly share code, notes, and snippets.

@joshuacerbito
Created May 23, 2016 03:38
Show Gist options
  • Save joshuacerbito/2e282057898712b60460bde6e9d35917 to your computer and use it in GitHub Desktop.
Save joshuacerbito/2e282057898712b60460bde6e9d35917 to your computer and use it in GitHub Desktop.
Native JS Object Selector
function $$(selector, context) {
context = context || document;
var elements = context.querySelectorAll(selector);
return Array.prototype.slice.call(elements);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment