<!DOCTYPE html>
<html>
<body>
<p>Text Text Text</p>
<button onclick="ReplaceContent()">Replace Content</button>
<script>
function ReplaceContent() {
document.open("text/html","replace");
document.write("<h1>Title H1</h1>");
document.write("<p>Paragraph P</p>");
document.body.style.backgroundColor = "white";
document.close();
}
</script>
</body>
</html>