Search.../

enable( )

Enables the element and sets its enabled property to true.

Description

The enable() function returns a Promise that is resolved when the element's enabled property has been set to true.

To learn about the behavior of an enabled element, see the enabled property.

Syntax

function enable(): Promise<void>

enable Parameters

This function does not take any parameters.

Returns

Fulfilled - When the element's enabled property has been set to true.

Return Type:

Promise<void>

Related Content:

Was this helpful?

Enable an element

Copy Code
1$w("#myElement").enable();
Enable an element and log a message when done

Copy Code
1$w("#myElement").enable()
2 .then( () => {
3 console.log("Element now enabled");
4 } );
Toggle an element's enabled state

Copy Code
1if( $w("#myElement").enabled ) {
2 $w("#myElement").disable();
3}
4else {
5 $w("#myElement").enable();
6}