W26 // THE DOM AND EVENTS
MAR 10 · Ch 11 Sec 1-4 · DUE: DOM manipulation page
This week's deckPPTX
// RUN OF SHOW (8:45-10:15)
8:45
Stand-up: last week's deliverable graded, questions answered
9:20
At the keyboard: guided type-along
9:45
Build time: assignment or project work
10:10
Close: commit, push, and preview next week's reading
// THE POINT THIS WEEK
The DOM as what JS sees. Selecting elements. Changing content and style. Events.
// TALKING POINTS
The DOM is the page, live
- The browser turns HTML into a tree of objects JS can touch
- document.querySelector finds an element; .textContent changes it
- Change the DOM and the page changes, no refresh needed
Events wire it up
- addEventListener('click', fn) makes an element respond
- The function runs later, when the event happens: that's the shift
- Page loads, listeners attach, then everything waits for the user
// LINKS