Document.contentType

The Document.contentType read-only property returns the MIME type that the document is being rendered as. This may come from HTTP headers or other sources of MIME information, and might be affected by automatic type conversions performed by either the browser or extensions.

Note: This property is unaffected by <meta> elements.

Syntax

contentType = document.contentType;

Value

contentType is a read-only property.

Specifications

Specification Status Comment
DOM
The definition of 'Document.contentType' in that specification.
Living Standard Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
contentTypeChrome Full support 36Edge Full support 17Firefox Full support 1IE No support NoOpera Full support 23
Full support 23
No support ≤12.1 — 15
Safari Full support 9.1WebView Android Full support 37Chrome Android Full support 36Firefox Android Full support 4Opera Android Full support 24
Full support 24
No support ≤12.1 — 14
Safari iOS Full support 9.3Samsung Internet Android Full support 3.0

Legend

Full support  
Full support
No support  
No support