blockly > utils > dom > addClass

utils.dom.addClass() function

Add a CSS class to a element.

Handles multiple space-separated classes for legacy reasons.

Signature:

export declare function addClass(element: Element, className: string): boolean;

Parameters

Parameter Type Description
element Element DOM element to add class to.
className string Name of class to add.

Returns:

boolean

True if class was added, false if already present.