Returns the Document that this node belongs to.
Returns the Document that this node belongs to. If no document is associated with it, returns null.
MDN
This is defined on Node; we override it here because we know (from the fact that this is an HTMLElement) that we are getting an HTMLDocument here.
https://html.spec.whatwg.org/multipage/dom.html#htmlelement