Why does javascript overwrite Html codes
<p>I have just started learning javascript and my question is very basic question about javascript but i had to learn the logic behind it.</p>

<pre><code>   &lt;p id="demo"&gt;This is a paragraph.&lt;/p&gt;

  &lt;script type="text/javascript"&gt;
   document.getElementById("demo").innerHTML=Date();
  &lt;/script&gt;
</code></pre>

<p>With these codes, only date appears on the browser and browser ignores "This is a paragraph".Should not browser write first "This is a paragraph" and below that display date?Being in the same class means, javacript overwrites every tags of the same class?
Thanks</p>
