querySelector() (JavaScript)

document.querySelector() finds the first element on the page that matches a CSS selector. It is the standard way to grab an element so JavaScript can work…