[Jslib] forcing focus to next element...whatever it is.

Stephen Knight stknight at ultralifebatteries.com
Thu Sep 18 17:29:26 EDT 2003

Pete Collins wrote:

> Stephen Knight wrote:
>> is there a relatively painless way to get the window to change the 
>> focus to the _next_ element without requiring knowledge of the name of 
>> the next element?
>> ie; as if the user had hit the tab key (the user doesn't know the name 
>> of the next element).
>> (this way, if I rearrange my window, I don't have to worry about 
>> whether my code will focus in the correct order).
>> thank you for your time.
> Yea, this is something that keeps coming up. Take a look at this code:
>   http://www.mozdev.org/lxr/http/source/recall/package/recall.js#L55
> I need to add a general purpose routine to jslib library "commonWindow" 
> would be a good place. A func that returns an array of all the open 
> windows.

If I'm reading the code correctly, it appears to be going thru the browser windows and then starts 
looking in each window for elements where id == 'content'.

forgive me for being slow, but how would I find an (or the next) arbitrary element in a window that 
was willing to accept ".focus()"...by looking for a property by that name?

More information about the Jslib mailing list