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
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.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
contentType | Chrome Full support 43 | Edge Full support 17 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support 43 | Chrome Android Full support 43 | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support 4.0 |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown