<div id="containerDiv"></div>
#containerDiv {
position: absolute;
top: 0px;
width: 400px;
height: 100%;
padding: 5px;
font-size: .875em;
overflow-y: scroll;
}
document.getElementById("containerDiv").innerHTML = variableLongText;
How to reset the scroll position back to top of container div the next time?