Returns a Document
, the active document in the inline frame's nested browsing context.
Example of contentDocument
var iframeDocument = document.getElementsByTagName("iframe")[0].contentDocument; iframeDocument.body.style.backgroundColor = "blue"; // This would turn the iframe blue.
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'HTMLIFrameElement: contentDocument' in that specification. |
Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Basic support | Chrome Full support 43 | Edge Full support Yes | Firefox Full support Yes | IE Full support 8 | Opera Full support Yes | Safari Full support 10 | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile ? | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android ? |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
Document Tags and Contributors
Last updated by:
zhuangyin,