In javascript I always use docuemtn.getElementById to access DOM elements, but recently I accidentally accessed it using id only and it worked. Example:
<input id="element_id" type="text">
and in javascript
element_id.onclick=fun;
Is it correct code? Why does it work? (in all browsers I have)