Answer the question
In order to leave comments, you need to log in
How to move caret in div one line below?
There is a field .
How to programmatically move the caret to the next line (to the beginning)?
I could only move in the first line, and then ... alas ( Here is an example (jsfiddle.net) Tell me
how to do this? <div contenteditable="true"></div>
Answer the question
In order to leave comments, you need to log in
Like this: jsfiddle.net/97dw6382/2
In short, the range should be the element's DOM number, not the text offset.
Those. when there is text, then this is a text offset, but if any dom element is encountered, then its number must be indicated.
There is a more detailed description here: stackoverflow.com/a/6939886
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question