console.log("lang = " + document.documentElement.lang);
<html>
<head>
<meta http-equiv="content-language" content="es">
</head>
<body></body>
<html>
Why?
According to specification, If neither the node nor any of the node’s ancestors, including the root element, have either attribute set, but there is a pragma-set default language set, then that is the language of the node.