Skip to content

Instantly share code, notes, and snippets.

@ebonneville
Created May 8, 2012 21:34
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 ebonneville/2639515 to your computer and use it in GitHub Desktop.
Save ebonneville/2639515 to your computer and use it in GitHub Desktop.
// get the current value of the element's inner HTML
var myInnerHTML = document.getElementById("myElement").innerHTML;
for(var i = 0; i < 10; i++) {
myInnerHTML += "some value";
}
// reassign the element's inner html
document.getElementById("myElement").innerHTML = myInnerHTML;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment