Skip to content
0

katanakit-js / useAddClass

Function: useAddClass() ​

ts
function useAddClass(target, className): void;

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

Adds one or more CSS classes to the target element.

Parameters ​

ParameterTypeDescription
targetstring | ElementA CSS selector string or an Element instance.
classNamestringThe class name to add.

Returns ​

void

Example ​

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

Released under the MIT License.