Skip to content

Instantly share code, notes, and snippets.

@WarFox
Created September 24, 2012 13:23
Show Gist options
  • Save WarFox/3775927 to your computer and use it in GitHub Desktop.
Save WarFox/3775927 to your computer and use it in GitHub Desktop.
Change html content with vanilla javascript
<div id="myelement">Old Text</div>
function changeContent () {
var myelement = document.getElementById("myelement");
myelement.innerHTML= "New Text";
}
window.onload = changeContent ;
name: Change Content - Javascript
description: Change html element content using pure javascript
authors:
- Deepu Mohan Puthrote (WarFox)
normalize_css: no
@WarFox
Copy link
Author

WarFox commented Sep 24, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment