JavaScript 2025 · DOM and browser

Find elements

Get the first element that matches a CSS selector, or all matches.

const button = document.querySelector("#save");
const items = document.querySelectorAll(".item");

Official JavaScript 2025 documentation

More dom and browser commands

All dom and browser commands · JavaScript 2025 cheatsheet

Was this page helpful?