Document: contentType property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.
TheDocument.contentType read-only property returns theMIME type that the document is being rendered as. This may come from HTTP headers orother sources of MIME information, and might be affected by automatic type conversionsperformed by either the browser or extensions.
Note:This property is unaffected by<meta>elements.
In this article
Value
contentType is a read-only property.
Specifications
| Specification |
|---|
| DOM> # ref-for-dom-document-contenttype①> |