Click to See Complete Forum and Search --> : Determing Active Frame


anifled
12-08-2003, 03:28 PM
If there are several frames on a page how can you determine programmatically which one is currently active?

fredmv
12-08-2003, 03:37 PM
Use the onfocus event handler in each of the contained documents in the frames. Have this event handler call a function or other piece of JavaScript code in which sets a global variable, that contains the name of that specific frame. Then you could reference it easily among frames if you stored the variable in the parent document.