Glossary · Phase 8 · APIs
DOM
The tree of objects a browser builds from a page's HTML; JavaScript changes the page by changing it.
When a browser reads HTML it builds the DOM, a tree of objects:
documentat the root, elements such as<form>and<div>as branches, and text as leaves. JavaScript changes the page by changing that tree, and the browser redraws to match.
Try it now
The question for each line: could this text have come from a model or a user?
Learn it properly
A chat front end in the browser · The DOM and events, model text kept out of innerHTML, a streamed reply parsed from server-sent events, and a Stop button. About 35 minutes.
Other terms from the same lesson
- event listener: A function registered with addEventListener that runs each time something happens to an element, such as a click or a form submit.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.