What is the difference between window and document in the DOM? What does each represent?
Asked
Active
Viewed 335 times
-5
-
3Also it's not the "JS" DOM, it's the *browser* DOM, or more generally a DOM built by parsing HTML or XML. It really has nothing to do with JavaScript in any direct way. – Pointy Jun 20 '20 at 14:09
-
@Pointy sorry. will change it – Serket Jun 20 '20 at 14:09
1 Answers
1
The window command are the Web APIs that the browser has. It is always executed last because it is not Javascript and therefore the event loop will prioritize your JavaScript commands first. The document, on the other hand, is used for DOM manipulation to modify the HTML.

PD23
- 51
- 1