I am building a javascript file which find the tag on the page and overwrite what HTML has in e.g. when the page load the HTML is seen <h1>This is innerHTML </h1> and after the js file has loaded, it is <h1>This para has been reloaded</h1>.
If the net is fast it won't be visible but as I am creating it for end user/testing, I want to assume the internet is slow so only the JS code is loaded in the selector.
Is it possible?
<div>
<p id="one">This is the inner Text</p>
</div>
let p = document.getElementById("one");
p.innerHTML = "This is now rewritten"
You can make the div visible after your desired event completion like this:
let p = document.getElementById("one");
p.innerHTML = "This is now rewritten";
document.getElementById('myContent').style.display="block";
#myContent{
display:none;
}
<div id="myContent">
<p id="one">This is the inner Text</p>
</div>