I could not able to access a <div> through Javascript,if there is only a <div></div> in a HTML page
<p>I have written below code in a HTML file name as test.html</p>

<pre><code>&lt;div id="dd"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
  document.getElementById("dd").innerHTML="fdfdfd";
  alert(document.getElementById("dd").innerHTML);
&lt;/script&gt;
</code></pre>

<p>The above code is not working. Can someone help me. What is the reason ?</p>

<p>If I put a <code>&lt;body&gt;</code> tag or write anything, then it works fine and Its working in Google chrome.</p>
