title: What is the Difference between window.element and element while accessing DOM elements
body: <p>I like understand how browser differentiates between hello and window.hello in below-given code</p>
  
  <p><a href="http://jsfiddle.net/PH3t2/291/" rel="nofollow noreferrer">http://jsfiddle.net/PH3t2/291/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var hello = "new hello";
  console.log("variable hello : " + hello); // &lt;-- prints "new hello"
  console.log(window.hello); // &lt;-- logs HTML elements</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="mainWrapper"&gt;
    &lt;div class="mainBox" id="hello"&gt;
      main
    &lt;/div&gt;
    &lt;div class="clear" id="hello"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How does specified window print HTML elements rather than the string <code>"new hello"</code>?</p>