A crossbrowser example on how to change the background color of the document contained in an iframe:
The contentWindow property returns the Window object generated by an iframe element (through the window object, you can access the document object and then any one of the document's elements).
The contentWindow property is supported in all major browsers.
Return Value: | A reference to the window object |
---|
Another example of how to access the document of an iframe to change the background color: