Posted by Martin Webb on June 10, 1998 at 03:35:44:
In Reply to: Who has the focus? posted by Rachel on June 09, 1998 at 15:23:53:
: Folks, how can I find out which frame of my page has the focus
: if there is no way I know how many frames I have on that page?
Frames/Windows do not have a focus property that you can interrogate to find out whether the frame/window has focus.
<BODY onFocus="parent.focus='xyz'" onBlur="parent.focus=''">
The above code will set a variable called focus in the parent frame to 'xyz' when the frame gains the focus, and resets it to blank when it loses focus. You could then interrogate the value of this variable.
To find out how many frames are in the current document: