i = 0 var speed = 1 function scroll() { i = i + speed var div = document.getElementById("rates1") div.scrollTop = i if (i > div.scrollHeight - 200) {i = 0} t1=setTimeout("scroll()",100) }