I almost never use inline event handlers (ie onchange='...' etc) so I was perhaps surprised to see the following code that works...
<form oninput="sum.value=parseInt(i1.value)+parseInt(i2.value);">
<input type="number" min="0" name="i1" value="0"> +
<input type="number" min="0" name="i2" value="0"> =
<output name="sum" onclick="sum.value = i1.value = i2.value = 0">0</output>
</form>
That is, in the oninput and onclick expressions the symbols sum, i1 and i2 are bound to the DOM objects of the same name attribute value - changing the input values updates the output value.
If these handlers were added via javascript as opposed to HTML attributes, those symbols would not be automatically bound to DOM nodes and the code would have to do some extra work to get the DOM nodes in question.
But when handlers are inline, if I break into the handler I can see Scope objects have been constructed that bind these symbols.
I'm not intended to use this but I'm curious - I can't find any documentation of this scoping mechanism that appears to be specific to inline handlers.
Is this an old mechanism that's deprecated but still supported, or am I just looking in the wrong places for documentation, or what?
To be clear - I can see how it works, and I understand handlers and DOM manipulation. I'm looking for any kind of authoritative definition of the mechanism of how the names are scoped to bind to the DOM nodes within the handler expressions.