Guides
Submit Documentation FeedbackJoin Developer CommunityLog In

Reset JS is used to "clean up" after a extension. It's used in the editor when changing field values or removing an existing extension. Reset JS should remove the element and any other side-effects.

One way to write reset JS is to use the extension.$instance value. For example, you could create a extension with HTML starting like this:

<div class="banner" data-extension-instance="{{extension.$instance}}">

Then remove it using Reset JS:

$("[data-extension-instance=" + extension.$instance + "]").remove();

Did this page help you?