Search.../

disable( )

Disables the element and sets its enabled property to false.

Description

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

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

Syntax

function disable(): Promise<void>

disable Parameters

This function does not take any parameters.

Returns

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

Return Type:

Promise<void>
Mixed in from:$w.DisabledMixin

Related Content:

Was this helpful?

Disable an element

Code Example

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

Code Example

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

Code Example

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