-
-
Save IvikGH/45f8c4b29aef464909e647f137168e97 to your computer and use it in GitHub Desktop.
Change html content with vanilla javascript
This file contains hidden or 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 hidden or 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 hidden or 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