Element representation of target.
Element, EventTarget, or CSS selector.
Array of dataset properties or attribute names to remove.
Element representation of the specified target.
elements!InvalidElementError if the specified target wasn't found.
HTML (Before)
<div
id="example"
data-is-active="false"
data-count="30"
data-label="Example"
>
...
</div>
Using Attribute Names (data-*)
const element = findElement("#example")!;
removeDatasetEntries(element, ["data-label", "data-count"]);
Using Property Names (camelCase)
const element = findElement("#example")!;
removeDatasetEntries(element, ["label", "count"]);
HTML (After)
<div
id="example"
data-is-active="false"
>
...
</div>
Removes the dataset entries with the attribute/property names
keysfrom thetarget.