what is document.getElementById?
<p><strong>consider the following code:</strong></p>

<pre><code>&lt;script&gt;
function testFunc(){
    alert('test')
}
$(function(){
    var g = document.getElementById , w = window.testFunc ;
    //g
    alert(typeof(g));
    alert(String(g));
    alert(g instanceof Object);
    alert(g instanceof Function);
    //w
    alert(typeof(w));
    alert(String(w));
    alert(w instanceof Object);
    alert(w instanceof Function);
    //run it
    alert(g('t'));
            w();

});
&lt;/script&gt;
</code></pre>

<h2><strong>the code behaves the same in modern browser(chrome,IE 9,Firefox).And the result is:</strong></h2>

<p>typeof => "function"<br/>
String => "function #funcName#{[native code]}"<br/>
instanceof Object => true<br/>
instanceof Function => true<br/>
it is a little weird, we can easily invoke <code>w</code> by using <code>()</code>, but for <code>g</code>, we must invoke it like this:</p>

<pre><code>g.call(document,elementId);
</code></pre>

<p>When it comes to IE 6, the result is totally diffrent:</p>

<hr>

<p>//g<br/>
<b>typeof => "object"</b><br/>
String => "function getElementById{[native code]}"<br/>
instanceof Object => false<br/>
instanceof Function => false<br/>
//w<br/>
<b>typeof => "function"</b><br/>
String => "function testFunc{alert('test')}"<br/>
instanceof Object => true<br/>
instanceof Function => true<br/>
what is more,we must run g and w directly by using '()', and we can not invoke g like this:</p>

<pre><code>g.call(document,'t')
</code></pre>

<p>this will cause an error.
So here is my question: what is <code>document.getElementById</code>, function or object, and what is the diffrence between <code>g</code> and <code>w</code>?</p>
