Search.../

enabled

Indicates if the element is enabled or disabled.

Description

If enabled is true, users can interact with the element.

If enabled is false, users cannot interact with the element.

When an element is disabled:

  • Its color is faded or grayed out.
  • Animations that the element normally exhibits when being interacting with do not occur.
  • Actions that the element has been configured to perform, such as opening a link, do not occur.
  • Event handlers that have been bound to the element, such as with onMouseIn, do not run.
  • If the element is an input element, such as a dropdown or text box, users cannot interact with it.

To set the enabled property of an element, use the element's enable() or disable() functions.

The enabled property can also be set in the Editor using the Properties and Events panel.

Type:

booleanRead Only
Mixed in from:$w.DisabledMixin

Related Content:

Was this helpful?

Get an element's enabled status

Copy Code
1let isEnabled = $w("#myElement").enabled; // true
Toggle an element's enabled state

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