Accessing a div using id without getElementById and jQuery
<p>I believe that the standard way in JS to access an element with an id is by using getElementById. If people like to use jQuery, then they probably will use their selectors. But recently I came across a very simple code example which is below:   </p>

<p>HTML:</p>

<pre><code>&lt;div id="h"&gt;Hello&lt;/div&gt;
</code></pre>

<p>JS:</p>

<pre><code>h.innerHTML = "Too bad";
</code></pre>

<p>This is the only code and there are no other variable declarations, just for people to know.<br>
How are we able to access the div element as if it is a Javascript object?</p>

<p>P.S. : The code example works.</p>