[Mozile] putting focus programmatically

James A. Overton james at overton.ca
Thu Jul 26 05:13:18 PDT 2007


Probably the best way to do this is to set the selection  
programmatically:

var sel = mozile.dom.selection.get();
sel.collapse(targetTextNode, targetOffsetInteger);

James


On 2007-07-26, at 7:04 AM, Eduardo Carlos Hamerski Jr wrote:

> Hi there,
>
> In my project can have many areas to be edited.
> Firstly the user needs to select one and when one of that areas is
> selected, editElement function is called for that area.
> Because this behavior, the user needs to click twice to put the  
> focus in
> that area and starts the edition.
> Is there a way to put the focus, programmatically, in that area and
> avoid twice clicks?
>
> PS. When I say put the focus I am thinking in put the cursor inside  
> the
> selected area to start the edition.
>
> Thanks a lot.
> Best regards.
>
> Hamerski.
> _______________________________________________
> Mozile mailing list
> Mozile at mozdev.org
> http://mozdev.org/mailman/listinfo/mozile



More information about the Mozile mailing list