javascript - document.getElementById("someId") Vs. someId -
this question might seem silly, what's difference between accessing element (with id "someid") using document.getelementbyid("someid") vs. typing someid ?
eg:
document.getelementbyid("someid").style.top = "12px";
vs
someid.style.top = "12px";
here's sample code http://jsfiddle.net/prata/ (i found doesn't work in firefox)
the difference while someid
works in browsers, document.getelementbyid("someid")
complies w3c standard.
Comments
Post a Comment