Change Content - Javascript
Change html element content using pure javascript author(s): Deepu Mohan Puthrote (WarFox)
by Chris
HTML
<img id="myelement" #vss_2>Old Text</img>
JavaScript
function changeContent () {
var myelement = document.getElementById("myelement");
myelement.innerHTML= `<p>Ahead of today's referendum, the President wrote an open letter to
all registered voters. In it, she admitted that the country was divided.</p>
<figure>
<img src="president.jpeg"
alt="A high forehead, cheerful disposition, and dark hair round out the President's face.">
<figcaption> The President of Ruritania. Photo © 2014 PolitiPhoto. </figcaption>
</figure>;`
}
window.onload = changeContent ;