Skip to content

Instantly share code, notes, and snippets.

@bplaat
Created August 12, 2017 18:02
Show Gist options
  • Select an option

  • Save bplaat/99c7b1855a5f5a287a5d7a49c53e2940 to your computer and use it in GitHub Desktop.

Select an option

Save bplaat/99c7b1855a5f5a287a5d7a49c53e2940 to your computer and use it in GitHub Desktop.
Simple jQuery like js dom selector
const $ = (query) => Array.from(document.querySelectorAll(query));
$('button').forEach(btn => console.log(btn.innerHTML));
@bplaat
Copy link
Copy Markdown
Author

bplaat commented Aug 12, 2017

A nice jquery like js dom selector that is easy to use!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment