Skip to content

Instantly share code, notes, and snippets.

@jjmu15
Created January 21, 2014 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjmu15/8540441 to your computer and use it in GitHub Desktop.
Save jjmu15/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