Created
September 24, 2012 13:23
-
-
Save WarFox/3775927 to your computer and use it in GitHub Desktop.
Change html content with vanilla javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="myelement">Old Text</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function changeContent () { | |
var myelement = document.getElementById("myelement"); | |
myelement.innerHTML= "New Text"; | |
} | |
window.onload = changeContent ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Change Content - Javascript | |
description: Change html element content using pure javascript | |
authors: | |
- Deepu Mohan Puthrote (WarFox) | |
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://jsfiddle.net/gh/gist/library/pure/3775927/