Possible Duplicate:
document.getElementById(“someId”) Vs. someId
For example I have an element with id="mybox"
attribute, is there any difference between calling it with document.getElementById('mybox')
and mybox
directly, as I see both work same in most browsers? The jsfiddle shows live example http://jsfiddle.net/usmanhalalit/TmS3k/
If there is no difference then why document.getElementById('mybox')
is so popular, is it a bad practice to call mybox
directly?