Click the following link to see the name I have given this iframe Link 1
This information was found by using parent.frames[0].name
Using parent.frames[0].document.title you can find the title of the document in the iframe
Title?
Using parent.frames[0].document.getElementsByTagName('P').length you can find out how many P tags I have used in this document.
P tags used?
As you can see not only can you reference the frame itself but also the document and its objects.
You can also reference nested frames.
The framesets you see below are themselves in an iframe, so including my frameset there is a 2 frame frameset containing 2 Iframes each containing a number of frames.
|
A script confirms the following.
Click here to reference the main frame in the 2nd nested frame |
Frameset 1 with 2 frames |
| Frameset 2 with 4 frames | |
parent.frames[0].frames[0].frames[0]
parent.frames[0].frames[0].frames[1]
parent.frames[0].frames[1].frames[0]
parent.frames[0].frames[1].frames[1]
parent.frames[0].frames[1].frames[2]
parent.frames[0].frames[1].frames[3]