querySelector() returns the first element in the document (or inside a specific element) that matches a CSS selector.

✔ Uses any valid CSS selector
✔ Returns one single element (the first match)
✔ Returns null if no element is found
✔ Very flexible and modern

Categorized in:

Javascript, JS DOM,