1let objDiv = document.getElementById("divExample");
2objDiv.scrollTop = objDiv.scrollHeight;
1window.setInterval(function() {
2 var elem = document.getElementById('data');
3 elem.scrollTop = elem.scrollHeight;
4}, 5000);
5
1const scrollToTop = () => {
2 const scrollTopButton = document.getElementById('scrollTopButton');
3
4 scrollTopButton.addEventListener('click', () => {
5 window.scrollTo(0, document.body.scrollHeight);
6 });
7};