Email conversation
From | Juan Marí Escanellas |
To | Me |
Subject | obtaining reference to element in a document inside IFRAME |
Date | 22 September 2004 12:13 |
In IE6 Frame also have a property Document with D capital you can get the
container of iframe like this:
document.getElementById(IdIframe).Document.getElementById(ElementID)
Juan Marí.
From | Me |
To | Juan Marí Escanellas |
Subject | Re: obtaining reference to element in a document inside IFRAME |
Date | 22 September 2004 12:50 |
Juan,
urgh :D - yet more incompatible stuff
I will stick with
document.frames['framename'].window.document.getElementById(elementID)
since it works in everything that supports iframes.
I am aware of things like contentDocument, contentWindow, Document and
document, all of which can be properties of the iframe element, but since
using them requires cross browser object detection, I don't see much point
in using them.
But thanks for taking the time to let me know, I may add something to my
tutorial to say that these exist.
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/