Search.../

enable( )

Enables the mobile element and sets its enabled property to true.

Description

The enable() function returns a Promise that is resolved when the mobile 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 mobile 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("#myMobileElement").enable();
Enable a mobile element and log a message when done

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

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