Skip to content

Type Editor


Type Editor / @type-editor/menu / util/set-class / setClass

Function: setClass()

ts
function setClass(dom, cls, on): void;

Defined in: packages/menu/src/util/set-class.ts:9

Conditionally adds or removes a CSS class from an element.

Parameters

ParameterTypeDescription
domHTMLElementThe HTML element to modify
clsstringThe CSS class name to add or remove
onbooleanIf true, adds the class; if false, removes it

Returns

void