Frame/IFrame contentDocument property
Frame/IFrame Object
Definition and Usage
The contentDocument property returns the document contained in the frame as an HTML object.
The returned object can be processed using all standard DOM methods.
**Note:** For security reasons, the content of the document can only be accessed by another document under the same domain name.
Syntax
frameObject.contentDocument
or
iframeObject.contentDocument
Browser support





All major browsers support the contentDocument property
**Note:** If !DOCTYPE is specified, Internet Explorer 8 and later versions support the contentDocument property; for other IE versions, please use contentWindow attribute.
Example
Example
The browser example demonstrates how to modify the background color of the document in an iframe:
Try it »
Frame/IFrame Object