HTML DOM querySelector() Method
HTML DOM querySelector() Method
The querySelector() method is used to return first child element that matched specified CSS selectors of an element.
Syntax:-
Its syntax is:- element.querySelector(CSS selectors)
Return:-
Its return is:- first element that matched the specified CSS selectors
Further Explanation:-
Parameter | Description |
---|---|
CSS selectors | Required. Specifies one or more CSS selectors to match the element. |