Element representation of target
.
CSS selector string to find the element.
Optional
parent: null | ElementLikeOptional Element or EventTarget for parent.
Element of type E
if found, otherwise null
.
SyntaxError if the specified selector
is invalid.
Query the DOM to find the element using one of the specified options
in the
optionally specified parent
.
Element representation of target
.
Options for finding the element.
Use to specify search criteria for finding element(s). You can find elements by selector, dataset entries, or attributes.
To search for the existence of an attribute or dataset property (not the
value), set the value to null
.
Optional
parent?: Target | nullOptional parent Element, EventTarget, or CSS selector.
Optional
tagName?: TagName | stringOptional element tag name to limit search.
Optional
withAttributes?: Attributes<E> | AttributeName[] | AttributeNameKey/value pairs of attributes to search for.
Optional
withDataset?: Dataset | DatasetKey[] | DatasetKeyKey/value pairs of dataset entries to search for.
Optional
withSelector?: CssSelectorCSS selector search string.
Element of type E
if found, otherwise null
.
SyntaxError if withSelector
in the specified options
is invalid.
TypeError if the specified options
are invalid.
Query the DOM for an element matching the specified CSS
selector
in the optionally specifiedparent
.