# querySelectorAll()

*noun*

say it: **“KWEER-ee suh-LEK-ter AWL”** **/ˈkwɪəri səˈlɛktər ɔːl/**

A DOM method that returns every element matching a CSS selector.

## What is **querySelectorAll()** in JavaScript?

**querySelectorAll()** — A DOM method that returns every element matching a CSS selector, as a list you can loop over with `forEach`. `querySelector()` returns only the first match.

```javascript
document.querySelectorAll(".price").forEach(price => {
  price.classList.add("sale");
});
```

## In a sentence

- “**querySelectorAll**(".price") gave me every price on the page.”

Level: Journeyman · [More JavaScript terms at this level](https://www.ask-codey.com/glossary?category=javascript&level=3)

Updated: October 28, 2026

Source: https://www.ask-codey.com/glossary/queryselectorall
