Skip to content

Instantly share code, notes, and snippets.

@tzi
Created Oct 6, 2018
Embed
What would you like to do?
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