JSFiddle - React, Tailwind, and code Playground
HTML
<button id="changeElementColorButton">Change color and show "myElement"</button>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div id="myElement">Hello!</div>
<p> </p>
<p> </p>
<p> </p>
JavaScript
(function() {
document.getElementById('changeElementColorButton').addEventListener('click', function() {
document.getElementById('myElement').style.color = 'red';
window.scrollTo(0, document.body.scrollHeight || document.documentElement.scrollHeight);
});
})();