我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译
您也可以阅读此文章的English (US)版。

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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 43Edge Full support YesFirefox Full support YesIE Full support 8Opera Full support YesSafari Full support 10WebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

文档标签和贡献者

此页面的贡献者: sideshowbarker, fscholz, ryanpcmcquen
最后编辑者: sideshowbarker,