Changing the page
Lesson 13 of 20 · Web.Micro
The DOM is the page as JavaScript sees it: a tree of elements you can find and change.
document.querySelector("h1") returns the first element that matches the selector, the same selectors you use in CSS. querySelectorAll returns all of them.
Check yourself
What does document.querySelector(".hours") return?
Do it in the browser: a real HTML, CSS and JavaScript tool, a short mission and instant feedback. No install.
Start this lesson — free