HTML DOM APIs

JavaScript alone knows nothing about pages. Every time a script reads a form field, adds a list item, reacts to a click or measures an element, it goes through the Document Object Model: the tree of objects the browser builds from your HTML.

This chapter starts with what the DOM is and what a change costs in rendering work, then tours the window object, node and element interfaces, HTML element objects, tree walkers and observers, and the event system.

The final sections cover patterns that keep DOM code fast and safe from cross-site scripting, how React 7,897 , Vue 5,482 and Solid 269,718 update the DOM for you, and where jQuery 561 , Alpine.js 208,904 and htmx 79,053 still fit.

What you will learn:

Sections