Is a JavaScript object automaticaly created for every HTML id?
<p>I'm giving a JavaScript course, and one of my students came up with a weird syntax that works but I don't understand why. I understand what it does, but would like to know if it is part of the JavaScript standard to react this way, or if it's a Firefox "glitch". 
The question was simply to have a paragraph turn green or red depending if the mouse is over another paragraph. His answer was:</p>

<pre><code> &lt;p id ="p1"&gt;a text&lt;/p&gt;
 &lt;p onmouseover = "p1.style.color = 'red';"
    onmouseout = "p1.style.color = 'green';"&gt;another text&lt;/p&gt;
</code></pre>

<p>What I find strange is the "p1.style" part. What is p1? I understand that it is the <code>&lt;p id="p1"&gt;</code>. But does JavaScript automatically create an object for every ID?</p>
