liveBook · Manning

Window

As explained in Secrets of the JavaScript Ninja, Second Edition

The browser-provided global object representing a browsing context and exposing browser APIs.

The browser exposes `window` as the global object representing the window containing a page. JavaScript uses it to access global objects, variables, and browser APIs; its `document` property represents the page’s DOM. section 2.2.2

Accessing the page

Use `document.getElementById("first")` to select an element, then JavaScript can change its content or attributes, add children, or remove it. section 2.2.2

var first = document.getElementById("first");

See the element-selection example using the global `document` object. section 2.2.2

How Secrets of the JavaScript Ninja, Second Edition covers it

How deep it goes
Defines the global object and connects its `document` property to DOM access, without detailing other browser APIs.
Examples
Uses `document.getElementById("first")` to select a DOM element for modification.
What you can do after
Understand how JavaScript accesses browser APIs and the page DOM through the global object.
How it connects
Connects the JavaScript engine, browser APIs, `document`, and the DOM.

Also explained in

Compare how 4 books explain window →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secrets of the JavaScript Ninja, Second Edition. The section links point to the parts of the book it draws on.