Skip to content

Instantly share code, notes, and snippets.

@MakingJamie
Created January 21, 2014 13:52
Show Gist options
  • Select an option

  • Save MakingJamie/8540441 to your computer and use it in GitHub Desktop.

Select an option

Save MakingJamie/8540441 to your computer and use it in GitHub Desktop.
Vanilla js - for each class
var myObj = document.getElementsByClassName('class');
for (var i = 0; i < myObj.length; ++i) {
var item = myObj[i];
item.innerHTML = 'this is value';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment