When describing DOM trees, most sources I found online describe the DOM tree as consisting of nodes.
I found this incredibly confusing, as I thought the DOM tree was actually just a tree of JS objects built into the Browser Runtime Environment.
My questions are as follows:
- Is the DOM tree really just consisting of ECMAScript objects?
- How are these objects connected to create the tree? E.g., is there a children property on each?
- Is Node an actual object, to which other objects are prototype linked? For example, an element in a HTML document is represented in the DOM tree as an instance of the HTMLElement constructor function (const foo = new HTMLElement()), which in turn is [[prototype]]-linked to Element.prototype, which in turn is [[prototype]]-linked to Node.protoype?