Property or attribute name for the dataset entry.
Optional
value: null | DatasetValueOptional value of the dataset entry.
Optional
tagName: TagNameOptional tag name for the element.
CSS selector based on the specified key
and optional value
.
Dataset Key without Value
selectDatasetEntry("someThing");
// `[data-some-thing]`
data-
Attribute Name without Value
selectDatasetEntry("data-some-thing");
// `[data-some-thing]`
Dataset Key with Value
selectDatasetEntry("someThing", "stuff");
// `[data-some-thing="stuff"]`
data-
Attribute Name with Value and Tag
selectDatasetEntry("data-some-thing", "stuff", "a");
// `a[data-some-thing="stuff"]`
Attempts to build a valid selector for a dataset with the specified
key
and optionalvalue
. IftagName
is specified, it is included in the resulting selector.