Structed representation of HTML documents.
Allows JavaScript to access HTML elements and styles to manipulate them.
❗manipulate means - changing text, HTML attributes, and even CSS styles.
<html>
<head>
<title>A Simple Page</title>
</head>
<body>
<section>
<p>A paragraph with a <a>link</a></p>
<p>A second paragraph</p>
</section>
</body>
</html>
Dom always starts with the DOCUMENT element from the very top.
Special object that is the entry point to the DOM.
ex) document.querySelector()
usually has two child elements, head and body
As we keep going deeper into the nested HTML structure, we keep adding more and more children to the DOM tree.
has title element
has section element
has p element
has a element
DOM Methods and Properties for DOM Manipulation are part of JS.
But it's not the case.
JavaScript is actually just a dialect of the ECMAScript specification,and all this DOM related stuff is simply not in there.
The DOM and DOM methods are actually part of something called the web APIs.
The web APIs (Application Programming Interface) are like libraries that browsers implement and that we can access from our JavaScript code.
Besides the DOM, there are a ton more web APIs, such as timers, the fetch API, and many more.
source from : The Complete JavaScript Course 2023 by jonas in Udemy