UseAddClass
katanakit-js / useAddClass
Function: useAddClass()
Section titled “Function: useAddClass()”function useAddClass(target, className): void;Defined in: infrastructure/dom/dom.service.ts:153
Adds one or more CSS classes to the target element.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
target |
string | Element |
A CSS selector string or an Element instance. |
className |
string |
The class name to add. |
Returns
Section titled “Returns”void
Example
Section titled “Example”useAddClass("#header", "sticky");useAddClass(myElement, "visible");