How do I use JavaScript to change the HTML of a webpage? Temporarily, only for the time they are on the webpage I am making a chrome extension to change the 404 that I get at randomsiteisay.com/randomsitepage Pretty much that the unused webpage gets its HTML changed to what I want it to be.
What I have:
var body1 = '\
<div id="header"><h1>Server Error</h1></div>\
<div id="content">\
<div class="content-container"><fieldset>\
<h2>Dont go here</h2>\
<h3>Thats RT, EWW</h3>\
</fieldset></div>\
</div>\
'
var aNewBodyElement = document.createElement("body");
aNewBodyElement.id = "newBodyElement";
document.body = aNewBodyElement;
document.getElementById("newBodyElement").innerHTML = body1;