scrolltobottom javascript not working code example
Example 1: js scroll to bottom
window.scrollTo(0,document.body.scrollHeight);
Example 2: javascript auto scroll on bottom
const scrollToTop = () => {
const scrollTopButton = document.getElementById('scrollTopButton');
scrollTopButton.addEventListener('click', () => {
window.scrollTo(0, document.body.scrollHeight);
});
};