title: Do DOM tree elements with IDs become global properties?
body: <p>Working on an idea for a simple <code>HTMLElement</code> wrapper I stumbled upon the following for Internet Explorer and <a href="http://en.wikipedia.org/wiki/Google_Chrome" rel="noreferrer">Chrome</a>:</p>
  <p>For a given <code>HTMLElement</code> with an <code>id</code> in the DOM tree, it is possible to retrieve the <code>&lt;div&gt;</code> using its ID as a variable name or as a property of <code>window</code>. So for a <code>&lt;div&gt;</code> like</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div id=&quot;example&quot;&gt;some text&lt;/div&gt;
  </code></pre>
  <p>in <a href="http://en.wikipedia.org/wiki/Internet_Explorer_8" rel="noreferrer">Internet Explorer 8</a> and Chrome you can do:</p>
  <pre class="lang-js prettyprint-override"><code>alert(example.innerHTML); // Alerts &quot;some text&quot;.
  </code></pre>
  <p>or</p>
  <pre class="lang-js prettyprint-override"><code>alert(window[&quot;example&quot;].innerHTML); // Alerts &quot;some text&quot;.
  </code></pre>
  <p>So, does this mean <em>every element in the DOM tree</em> is converted to a property on the global object? And does it also mean one can use this as a replacement for the <code>getElementById</code> method in these browsers?</p>