Skip to content

Instantly share code, notes, and snippets.

@tzi
Created October 6, 2018 05:57
Show Gist options
  • Save tzi/9c6c221758212ced73e0c92a4173acb3 to your computer and use it in GitHub Desktop.
Save tzi/9c6c221758212ced73e0c92a4173acb3 to your computer and use it in GitHub Desktop.
querySelectorAll but iterable
function $$ (query) {
return Array.from(document.querySelectorAll(query));
}
$$('a').forEach(function(link) {
console.log(link.innerHTML);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment