Replit
Run your first JavaScript snippets in a browser workspace.
Free and paid plans; usage limits and feature availability vary.
Explore toolLesson 3 of 3 · 11 min
The DOM is the live tree of the page. document.querySelector finds an element; textContent changes its text.
addEventListener reacts to clicks: button.addEventListener("click", celebrate).
Add a button to a page that changes a heading's text when clicked.
Optional resources
No purchase or partner signup is required to complete this course or earn quiz points.
These are official product links, not active affiliate links. Learnly does not currently earn a commission from them.
Run your first JavaScript snippets in a browser workspace.
Free and paid plans; usage limits and feature availability vary.
Explore toolLook up JavaScript and DOM references while you practice.
Free documentation.
Explore tool