auto scroll when overflow code example
Example 1: how to make auto scroll to the end in css
let objDiv = document.getElementById("divExample");
objDiv.scrollTop = objDiv.scrollHeight;
Example 2: javascript auto scroll on overflow to bottom
window.setInterval(function() {
var elem = document.getElementById('data');
elem.scrollTop = elem.scrollHeight;
}, 5000);