Search.../

deleted

Indicates if an element was temporarily deleted from the DOM. Use the restore function to restore the deleted element.

Description

If deleted is true, the element is not in the current DOM.

If deleted is false the element is in the current DOM.

Notes:

  • An element whose deleted status is true can be edited.
  • In Editor X, an element whose deleted status is false will not be displayed if the element has been set to "Don't Display".

Type:

booleanRead Only
Mixed in from:$w.Element

Related Content:

Was this helpful?

Get an element's deleted status

Copy Code
1const isDeleted = $w("#myElement").deleted; // true
Toggle an element's deleted state

Copy Code
1if( $w("#myElement").deleted ) {
2 $w("#myElement").restore();
3}
4else {
5 $w("#myElement").delete();
6}