Locating DOM elements

Most searches start at the document, the whole page, where getElementById finds an element by its id, querySelector finds the first match for a CSS selector, and querySelectorAll finds every match.

Updated

Cheat sheet: Locating DOM elements
Category
JavaScript
Level
Apprentice
Tags
getElementById(), JavaScript, querySelector(), querySelectorAll()