querySelector()

The DOM method that returns the first element matching a CSS selector, or null if nothing matches.

In more detail

It can be called on the document or on any element to search only inside it. Because it uses normal CSS selector syntax, anything you can style you can also find.

Related terms

Taught in

References