javascript scroll to top of div code example
Example 1: javascript scroll to top of page
//Instant scroll to top of page
window.scrollTo(0, 0);
Example 2: html scroll div to top
var myDiv = document.getElementById('containerDiv');
myDiv.innerHTML = variableLongText;
myDiv.scrollTop = 0;