JSFiddle - React, Tailwind, and code Playground
HTML
<div id="whatever"></div>
<button>add content</button>
CSS
div{
width:300px;
height:200px;
border:1px solid red;
overflow-y:auto;
}
JavaScript
var content = "test test<br>test test<br>test test<br>test test<br>",
divx = document.getElementById("whatever");
$('button').click(function() {
$('#whatever').append(content);
divx.scrollTop = divx.scrollHeight;
});