JSFiddle - React, Tailwind, and code Playground
HTML
<button id="replace-all">Replace all</button>
<button id="replace-content">Replace content</button>
CSS
* {
color: red;
}
JavaScript
document.getElementById("replace-all").addEventListener("click", function(e) {
e.preventDefault();
document.write("Everything is gone! Even the styling!");
});
document.getElementById("replace-content").addEventListener("click", function(e) {
e.preventDefault();
document.body.innerHTML = "Everything is gone! But not the styling!";
});