What is DOM?
> Document Object Model - a structural model that organizes a webpage's HTML document as an object. Using JavaScript, we can access and make changes to the HTML document through the use of this document object.
DOM can be seen as a link between a webpage's HTML file and the scripting language(most commonly JavaScript). The DOM allows you to use JavaScript to access and make changes to the HTML document by accessing the HTML's elements. So basically, JavaScript uses DOM to access HTML.
DOM has a tree structure and is composed of nodes.
document
object representing the HTML document itselfelement
node, a text
node, or an attribute
node