Dom\ParentNode::querySelector
(PHP 8 >= 8.4.0)
Dom\ParentNode::querySelector — Returns the first element that matches the CSS selectors
Description
Returns the first element that matches the CSS selectors specified in selectors.
Parameters
selectors- A string containing one or more CSS selectors.
Return Values
Returns the first Dom\Element that matches selectors. Returns null if no element matches.
Errors/Exceptions
Throws a DOMException with code Dom\SYNTAX_ERR when selectors is not a valid CSS selector string.
See Also
- Dom\ParentNode::querySelectorAll() - Returns a collection of elements that match the CSS selectors
↑ and ↓ to navigate • Enter to select • Esc to close • / to open