On a freshly built, up to date Windows 10 computer with default settings, I get the following results:
HTA #1 Output: "5"
<script>
alert(document.documentMode)
</script>
HTA #2 Output: "7"
<!DOCTYPE html>
<script>
alert(document.documentMode)
</script>
HTA #3 Output: "9"
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9">
</head>
<script>
alert(document.documentMode)
</script>
However, I have a report from a person on a Windows 10 machine that displays, as expected, "5" for HTA #1 and "9" for HTA #3, but also "9" for HTA #2. What setting would cause the observed behavior?
Note: This question differs from another similar question partly because it is targeted to HTA behavior (as opposed to the Internet Explorer application) and partly because the other question isn't clear about whether the results differ between documents with or without doctype declaration.