UseSetDataAttribute
katanakit-js / useSetDataAttribute
Function: useSetDataAttribute()
Section titled “Function: useSetDataAttribute()”function useSetDataAttribute( target, key, value): void;Defined in: infrastructure/dom/dom.service.ts:336
Sets a data-* attribute on the target element.
Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”void
Example
Section titled “Example”useSetDataAttribute("tr.row", "status", "active");