Skip to content

UseSetDataAttribute

katanakit-js / useSetDataAttribute

function useSetDataAttribute(
target,
key,
value
): void;

Defined in: infrastructure/dom/dom.service.ts:336

Sets a data-* attribute on the target element.

Parameter Type Description
target string | HTMLElement A CSS selector string or an HTMLElement instance.
key string The data key (without the data- prefix).
value string The value to set.

void

useSetDataAttribute("tr.row", "status", "active");