querySelector

The method querySelector() returns the first Element within the element that matches the specified selector, or group of selectors. If no matches are found, null is returned.

Querys

Example

elem.querySelector("#id") // Returns the FIRST element with the ID of id
elem.querySelector(".id") // Returns the FIRST element with the className of id
elem.querySelector("label") // Returns the FIRST element that is a LABEL

Last updated