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

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
contentTypeChrome Full support 43Edge Full support 17Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support 43Chrome Android Full support 43Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support 4.0

Legend

Full support
Full support
Compatibility unknown
Compatibility unknown