Converting HTML into a DOM
The DOM is the in-memory representation of the page, produced by parsing the HTML code.
In the DOM, there are no tags, only elements, and it is strictly a tree.
Most of HTML is defined in terms of the DOM - the syntax of HTML is only relevant to parsing.