if(document.getElementById)
{
alert( document.getElementById);//output: function getElementById(){ [native code] };
}
As in the above example, this method determines whether the browser supports the getElementById() method. Note , here the detection object in the if statement does not have brackets "()".