contentDocument

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.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) 8.0 (Yes) (Yes)
Feature Android Android Webview Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support (Yes) (Yes) 1.0.1 ? (Yes) (Yes) (Yes)

Document Tags and Contributors

 Contributors to this page: ryanpcmcquen
 Last updated by: ryanpcmcquen,