var myDiv = document.getElementById('containerDiv'); myDiv.innerHTML = variableLongText; myDiv.scrollTop = 0;