+ 1
How to AUTO SCROLL an output on web
lets say I have <div style="overflow-y:scroll"></div> I need to scroll it automatically when there is new text to show
3 Answers
+ 6
try using scrollTop...
example:
container=document.getElementById("container");
container.scrollTop =container. scrollHeight;
hope this help....
+ 2
Use
document.body.scrollTop = wrap.scrollHeight;
where wrap is a updating scrollable element.
Check out the code
https://code.sololearn.com/Wpel83cdJbol/?ref=app
+ 1
Thank you @leon
or by the way I am happy to have this answered