Skip to content

hasClass

Checks whether the element has a CSS class.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function hasClass(this: Element, cls: string): boolean

Parameters:

Parameter Type Description
this Element
cls string The class name to check.

Returns: boolean — true when the element has the class.