Skip to main content

HTML vs DOM

HTML - Is the textual representation of what was sent from the web server to the browser. DOM - Object model representation of the HTML. All script executions will only alter the DOM.

The source what we see on the browser using view source option is the HTML returned by the server, and it's without any changes executed by the client side scripts.

DOM on the other hand is the updated HTML. We can view the DOM using inspect option.