The Selectors API provides methods that make it quick and easy to retrieve Element nodes from the DOM by matching against a set of selectors.
Description
The Selectors API provides methods that make it quick and easy to retrieve Element nodes from the DOM by matching against a set of selectors.
This interface has the following two methods:
querySelector
- Returns the first matching Element node within the node's subtree. If no matching node is found, null is returned.
querySelectorAll
- Returns a NodeList containing all matching Element nodes within the node's subtree, or an empty NodeList if no matches are found.
Note: The NodeList returned by querySelectorAll() is not live. This is different from other DOM querying methods that return live node lists.