How to automatically scroll a text box on startup

I have an html text box with a scroll. Is it possible to get a window to jump to a specific point at boot time?

+3
source share
2 answers

You can use scrollTop

document.getElementById('your_div_id').scrollTop = 50;
+3
source

you can use the identifier at a specific point in the text:

<span id='scrollTo'>lorem ipsum...</span>

and then in the URL:

localhost/index.html#scrollTo

or

if you want to go to javascript route you can use jquery $ .scroll method

0
source

All Articles