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