I have a function:
function scrollDown() { var scrollHeight = document.documentElement.scrollHeight; var clientHeight = document.documentElement.clientHeight; scrollHeight = Math.max(scrollHeight, clientHeight); window.scrollTo(0, scrollHeight - document.documentElement.clientHeight) }
How to use it, so that when you open the page, it scrolls down?
<body onload="scrollDown()">
- does not work.