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?
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.