Why does this undefined variable refer to an element's id
<pre><code>&lt;div id="myDiv"&gt;&lt;/div&gt;

alert(myDiv); // alerts '[html HTMLDivElement]'
</code></pre>

<p>I don't understand how this seems to work. I thought you must specify the div element's id with <code>getElementById();</code></p>
