html tag with id can be used directly?
<p>Html tag with a unique id can be used as a variable named the id directly ?</p>

<p>code:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Document&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;input type="text" id="mytest"&gt;
&lt;/body&gt;
    &lt;script&gt;
        console.log(mytest);
        console.log(mytest === document.getElementById('mytest'));
        console.log(Object.hasOwnProperty(window,'mytest'));

    &lt;/script&gt;
&lt;/html&gt;
</code></pre>

<p>outputs : 
<a href="https://i.stack.imgur.com/ESs3Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ESs3Z.png" alt="enter image description here"></a></p>

<p>How could this be ? Where is <code>mytest</code>?</p>