I believe that the standard way in JS to access an element with an id is by using getElementById. If people like to use jQuery, then they probably will use their selectors. But recently I came across a very simple code example which is below:
h.innerHTML = "Too bad";
ids are created by default as properties of global object (in global context).
if you do
<div id="h22">Hello</div> it will create a global variable of
As per spec,
Otherwise return an HTMLCollection rooted at the Document node, whose filter matches only named objects with the name name. (By definition, these will all be elements.)
HTML elements that have an id content attribute whose value is name.
window can determine in the order given in the spec where to pick the value from.