/DOM & Events
Concept
Medium

DOM & Events

1 min read

The DOM (Document Object Model) represents an HTML document as a tree. Selection: getElementById, querySelector, querySelectorAll. Manipulation: innerHTML, textContent, style, classList. Events fire on user interactions. addEventListener attaches handlers. Events bubble up the DOM by default; capture phase descends. stopPropagation() halts bubbling. Event delegation attaches one handler to a parent to manage many children efficiently.

Practice Questions3

easy

Q1. What does `document.getElementById("app")` return if no element with that id exists?


Select one answer before revealing.

medium

Q2. What is event bubbling?


Select one answer before revealing.

medium

Q3. What is event delegation?


Select one answer before revealing.