Mock website during tutorials always scrolls back up when entering code into the script. How do I get that to stop?

The tutorials page that i am creating always scrolls back to the top any time I type in the code. I want to see how everything I am typing effects the actual outcome to the right. TIA

Do you have an example of what you are talking about?

It would be great if you had a link to your code on GitHub or and online IDE.

Things are unclear. Can u please brief a bit?