<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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…