[Project_owners] Mozilla Rich-Text

joe ertaba belaviyo at gmail.com
Fri Jun 5 12:44:52 PDT 2009


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 <neil at parkwaycc.co.uk> 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
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mozdev.org/pipermail/project_owners/attachments/20090606/15e11e80/attachment.html>


More information about the Project_owners mailing list