document object
The global object that represents the loaded page and is the root of the DOM tree, with methods such as querySelector and createElement.
In more detail
document.documentElement is the html element and document.body is the body. Workers cannot access document because they run away from the page's DOM.
Related terms
- DOM — The tree of objects a browser builds from a web page, which scripts read and change to update what is on screen.
- Window — The global object in a browser page, representing the browser tab, which holds globals such as document, location, setTimeout and fetch.
Taught in
- Event Phases: Capturing, Target And Bubbling Demystified — Frontend Architecture & Web Platform
- Web Workers: Off-Thread Computation And Structured Clone — Frontend Architecture & Web Platform