When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects:

document?document is a global object in the browser that represents the entire HTML page loaded in the browser window.document an object?Yes.
It is a JavaScript object with many properties and methods.
You often use it like this:
document.getElementById("myId");
document.querySelector(".my-class");
document.title;
The DOM (Document Object Model) does not change your original HTML file, but it creates a live object-based version of your HTML that JavaScript can read, modify, or delete.
Think of it like this: