querySelectorAll()
The DOM method that returns every element matching a CSS selector as a static NodeList.
In more detail
The list is a snapshot: elements added or removed later do not change it. That makes it safe to loop over while you modify the DOM.
Related terms
- querySelector() — The DOM method that returns the first element matching a CSS selector, or null if nothing matches.
- NodeList — A list-like collection of DOM nodes, returned by methods such as querySelectorAll.
Taught in
- Modern DOM Querying: querySelector, closest And matches — Frontend Architecture & Web Platform
- Modern Selectors: :has(), :is(), :where() And Nesting Standards — Frontend Architecture & Web Platform