changing the divs style using javascript explanation.
<p>Hi sorry if this is a duplicate but I don't know what to search. The code below work without me doing document.getElementByID. Why is that? and is this faster or the same or slower then getting the element by id. </p>

<p><a href="http://jsfiddle.net/eQXZa/" rel="nofollow">http://jsfiddle.net/eQXZa/</a></p>

<p>HTML</p>

<pre><code>&lt;div id="box1" style="background-color: #ff0000; width: 100px; height:100px;"&gt;&lt;/div&gt;
</code></pre>

<p>JS</p>

<pre><code>obj(box1);
function obj(object) 
{
    object.style.background = "#ccc";
}
</code></pre>
