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;
1//For a smooth scroll using jQuery animate
2$('#DebugContainer').stop().animate({
3 scrollTop: $('#DebugContainer')[0].scrollHeight
4}, 800);
5