JavaScript: Manipulating the DOM
- The DOM exposes the HTML tree as objects. `document.querySelector` finds nodes using CSS selector syntax.
- Set `el.textContent = "..."` to change content. Unlike server templates, you mutate the live tree at runtime.
Code
Loading...