Skip to content

UseAddClass

katanakit-js / useAddClass

function useAddClass(target, className): void;

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

Adds one or more CSS classes to the target element.

Parameter Type Description
target string | Element A CSS selector string or an Element instance.
className string The class name to add.

void

useAddClass("#header", "sticky");
useAddClass(myElement, "visible");