//scroll to the bottom of "#myDiv" var myDiv = document.getElementById("myDiv"); myDiv.scrollTop = myDiv.scrollHeight;