Yes it works but I cant find how to change the cursor position!

here is a example, in this example I want to change the position of cursor
to second char, but it doesn't work

<pre id="editor1" contentEditable="true" onclick="
selection = window.getSelection();
range = selection.getRangeAt(0);

startNode = document.getElementById('editor1');
startOffset = 2;
range.setStart(startNode, startOffset );
">editor 1</pre>

any idea ?

also is there any function to tell me the current location of cursor ?

Thanks

On Thu, May 28, 2009 at 1:50 PM, Neil <[email protected]> wrote:

> joe ertaba wrote:
>
>  Is there any way to find cursor position in
>> https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla
>> something like textbox's selectionstart, selectionend,...
>>
>
> window.getSelection() works with editable areas too, assuming it has focus.
> _______________________________________________
> Project_owners mailing list
> [email protected]
> https://www.mozdev.org/mailman/listinfo/project_owners
>
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners

Reply via email to