The DOM is a changeable model of the HTML elements. You see, the a web page could be directly rendered like this: HTML string -> pixels. However, this would make it hard to introduce dynamic behavior. (Lots of string search/replace in the HTML string.) So instead, the browser first parses the HTML into an object: HTML -> DOM. When the DOM changes, then the browser re-renders it. DOM -> pixels. The DOM can be changed by user interaction (for example, typing in a text input automatically updates the value attribute) or Javascript.
So it is basically a more convenient way to modify a displayed web page than directly changing the HTML string.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The DOM is a changeable model of the HTML elements. You see, the a web page could be directly rendered like this:
HTML string -> pixels
. However, this would make it hard to introduce dynamic behavior. (Lots of string search/replace in the HTML string.) So instead, the browser first parses the HTML into an object:HTML -> DOM
. When the DOM changes, then the browser re-renders it.DOM -> pixels
. The DOM can be changed by user interaction (for example, typing in a text input automatically updates thevalue
attribute) or Javascript.So it is basically a more convenient way to modify a displayed web page than directly changing the HTML string.