Search...
delete( )
Deletes an element from the DOM.
This is a temporary deletion. Use restore
to restore the deleted element.
SEO crawlers cannot find content in an element whose deleted
status is true
.
Content in an element that is in hidden
status can be found by crawlers.
Note: An element whose
deleted
status istrue
can be edited.
Description
The delete()
function returns a Promise that is resolved when the
element's deleted
property has been set to true
.
Authorization
Request
This endpoint does not take any parameters
Response Object
Fulfilled - When the element's deleted
property has been set to true
.
Returns an empty object.
Status/Error Codes
Was this helpful?
Delete an element from the DOM
Copy Code
1$w("#myElement").delete();
Delete an element from the DOM and log a message when done
Copy Code
1$w("#myElement").delete()2 .then( () => {3 console.log("Done with delete");4 } );