destroy()

Deletes the widget.

Widgets that aren’t needed anymore (because they have been superseded by a new version, for example), can be easily removed from a page by calling destroy() on them.

After deleting a widget using widget.destroy(), it can no longer be accessed. The result of a function call on a destroyed widget is not defined.

Examples

Directly delete a single widget:

Delete specific widgets from a page:

See Performing Bulk Operations for further usage examples.