blockly > utils > dom > hasClass

utils.dom.hasClass() function

Checks if an element has the specified CSS class.

Signature:

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

Parameters

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

Returns:

boolean

True if class exists, false otherwise.