Skip to main content

Home > 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

ParameterTypeDescription
elementElementDOM node where we set state.
stateNameStateState attribute being set. Automatically adds prefix 'aria-' to the state name if the attribute is not an extra attribute.
valuestring | boolean | number | string[]Value for the state attribute.

Returns:

void