If I have a HTML document containing this snippet:
<form name="my_awesome_form" action="http:///handler.blah" method="post">
<input type="text" name="test_input"/>
<input type="submit" value="submitter" />
</form>
Then I open the javascript console of firefox's developer tools, and type the word document.
> document.addEventListener
__proto__ <-- list of completions
activeElement
my_awesome_form
the developer tools generates a list of completions i.e. properties on the document object.
I can see that the name attribute name="my_awesome_form"
I gave to my form appears in this list and that is is a reference to the DOM element of my form.
My question is what is responsible for this and where can I find the documentation for this?
I have looked at MDN document API documentation but it seems that the browser has automatically added this post-processing of the page, so its obviously not hardcoded into the DOM API interface that the document
object inherits from.
I've also looked here https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268
but can't find an explanation there either.