Hi,
My question is simpel, I want to retrieve the position of the cursor inside CKEditor. I don't mean the cursor position within the current element/selection but the position within the whole 'textarea'.
This code only gives me the cursor position of the current selection.
I searched the API docs, this forum and went to page 20 on Google, but I can't find anything besides the code mentioned above. So I hope someone here has the answer.
My question is simpel, I want to retrieve the position of the cursor inside CKEditor. I don't mean the cursor position within the current element/selection but the position within the whole 'textarea'.
This code only gives me the cursor position of the current selection.
var selectedRange = selected.getRanges()[0]; var node = selectedRange.startContainer; var value = node.getText(); var position = selectedRange.endOffset;
I searched the API docs, this forum and went to page 20 on Google, but I can't find anything besides the code mentioned above. So I hope someone here has the answer.
Re: Real cursor position
i would like to know the solution too ^^
Re: Real cursor position
If you want something else (be it position in the visible text, in the HTML source or whatever), you'll have to develop your own code, but chances are high that maybe you are searching for the wrong thing and instead whatever you want should be done in another way or someone else probably has already done something similar (and you might have discarded it because you didn't like how it looked).