Skip to content
Advertisement

How to remove a jquery UI element without removing elements?

Say I have some html that looks like thsi:

JavaScript

If I then type

JavaScript

In console, it transforms it into a sortable. (jquery required) Now, If I want to reset it back to the original html, How can I do that? If I type:

JavaScript

It removes all the html.

Is there a method that removes whatever .sortable() creates?

Advertisement

Answer

Use the destroy method.

JavaScript

From the documentation:

Removes the sortable functionality completely. This will return the element back to its pre-init state.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement