25.168. IFrame: an <iframe> in an HTML documentDOM Level 2 HTML: Node Element HTMLElement IFrame25.168.1. PropertiesAs explained in the following Description, iframe elements can be accessed as IFrame objects or as Window objects. When accessed as IFrame objects, they inherit properties from HTMLElement and define the additional properties below:
In addition to these properties, the IFrame object also defines the following properties, which correspond directly to HTML attributes of the <iframe> tag:
25.168.2. DescriptionExcept for small differences in their HTML attributes, <iframe> elements behave very much like <frame> elements in client-side JavaScript. <iframe> elements become part of the frames[] array of the containing window. When accessed through that array, they are represented by Window objects, and the properties listed earlier do not apply. When an <iframe> element is accessed as a document element by ID or tag name, it is represented by an IFrame object, with the properties shown previously. Use src to query or set the URL of the <iframe>, and use contentDocument to access the contents of the iframe. Be aware, however, that the same-origin policy (see Section 13.8.2) may prevent access to the contentDocument. 25.168.3. See AlsoFrame, Window; Chapter 14 |