Why is it possible to refer to an element in HTML via JS without the need to go through document? And is this recommended?
For example
index.html
<canvas id="elem" onclick="foo();">
script.js
function foo() {
elem.width = 100;
elem.height = 100;
}