Skip to content

Instantly share code, notes, and snippets.

@denismcdonald
Created July 11, 2018 10:25
Show Gist options
  • Save denismcdonald/151ab933a4cc307962349b76aa117975 to your computer and use it in GitHub Desktop.
Save denismcdonald/151ab933a4cc307962349b76aa117975 to your computer and use it in GitHub Desktop.
forEach method for querySelectorAll (JavaScript)
var elements = document.querySelectorAll("h1");
Object.keys(elements).forEach(function(key) {
elements[key].style.color = "orange";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment