1// To scroll to the bottom of a div
2const theElement = document.getElementById('elementID');
3
4const scrollToBottom = (node) => {
5 node.scrollTop = node.scrollHeight;
6}
7
8scrollToBottom(theElement); // The specified node scrolls to the bottom.
1//scroll to the bottom of "#myDiv"
2var myDiv = document.getElementById("myDiv");
3 myDiv.scrollTop = myDiv.scrollHeight;