Skip to main content

blockly > utils > aria > setState

utils.aria.setState() function

Sets the state or property of an element. Copied from Closure's goog.a11y.aria

Signature:

export declare function setState(element: Element, stateName: State, value: string | boolean | number | string[]): void;

Parameters

Parameter

Type

Description

element

Element

DOM node where we set state.

stateName

State

State attribute being set. Automatically adds prefix 'aria-' to the state name if the attribute is not an extra attribute.

value

string | boolean | number | string[]

Value for the state attribute.

Returns:

void