Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Run Away! Run Away!

The knights encounter the DOM. It’s enormous. It’s imperative. It mutates everything it touches. There are 117 methods, and that’s just the ones someone counted.

“Run away! Run away!”

“We can’t — the browser is our deployment target.”

A pause.

“Then we shall face the DOM.”

“With colon syntax?”

“With colon syntax. And fn for event handlers. And cell for state.”

The knights advance cautiously. document:query-selector turns out to be quite nice. el:add-event-listener works as expected. The DOM doesn’t bite — it just mutates. And mutations, as the knights learned in Chapter 13, are manageable when they’re explicit.