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?

Was it helpful?

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
scroll top