Suppose, as an example, the following exact test.html
document, saved in UTF-8 encoding:
<html>
<head>
<title>Test</title>
</head>
<body>
Test document.
</body>
</html>
How can I determine in IE11 and Chrome latest what the browser decided to guess for a doctype, if any? (Note that the document above is merely an example, I'm looking for a method to determine doctype as assumed by the browser, not an answer to this instance. (Teach me how to fish!))
I searched and found this related question where answers mention document.doctype
, but that's null
in Chrome and undefined
in IE11.
I also tried all sorts of other searches, for example this one, but this only results in posts about setting a correct doctype.
I've gone through the developer tools of both Chrome and IE11 but didn't find it (perhaps just didn't see it).
I've carefully reviewed all suggested duplicate questions on Stack Overflow, as well as the "Similar Questions" in the side bar, but none quite answer my question.
Bottom line: can JavaScript (preferred) or the browser's developer tools be used to find out what document mode was assumed? Or are there specs or known rules for this?