jQuery UI - when should I use destroy method on the widgets
-
08-07-2019 - |
Question
When I attach functionality to an element do I need to call .widgetName('destroy')
before removing it from the DOM or does jQuery handle this?
Solution
Try using remove
.
I don't think this happens automatically, but then again, I don't think you need to call the destroy
method as the event handlers
are destroyed for you from the remove call.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow