I am creating a markdown editor, where you write in the left column, and the result is shown in the right column. Similar to SO's markdown editor.
The problem is that when your texts get long, you cannot see the result anymore because it is too far down and out of the viewport.
I can get the current cursor position within the textarea. I can also get the text within the div element and strip it of HTML tags.
Is there a way to scroll a div to its nth character, without setting any anchors?
EDIT: I am not looking for a way to make the page scrollable. I am asking if it is possible to scroll to a specific position within the text of a div element without setting anchors around every word. Is it even possible?
EDIT2: @Cbroe is exactly right. My question indeed becomes: How can I figure out where on my page a certain character is?