innerHTML isn't working
<p>The <code>innerHTML</code> isn't working in this JavaScript code.</p>

<pre><code>var date = new Date();
var time = date.getHours();
var morning = document.p.getElementById("greeting").innerHTML="Good Morning ";
var afternoon = document.write =  "Good Afternoon ";
var evening = document.write = "Good evening";

if (time &lt; 12){
    morning}
else if (time &lt; 18){
afternoon}
else {evening};
</code></pre>

<p>The HTML code is </p>

<pre><code>&lt;p id="greeting"&gt; &lt;/p&gt;
</code></pre>

<p>I am trying to get the code to read "good morning" or "afternoon", based on the time. The JavaScript is in an external file. It worked with <code>document.write</code> but in the external file, the greeting appears at the top of the page. </p>
