html roll div até o topo
var myDiv = document.getElementById('containerDiv');
myDiv.innerHTML = variableLongText;
myDiv.scrollTop = 0;
Friendly Finch
var myDiv = document.getElementById('containerDiv');
myDiv.innerHTML = variableLongText;
myDiv.scrollTop = 0;
body {
height: 4000px;
width: 4000px;
}
.main{
position: fixed;
}
var myMain = document.getElementById('main');
var number = 0;
myMain.onclick = function () {
'use strict;
number += 100;
window.scrollTo(0, number);
console.log(window.scrollY);
};