I have an element that is resizable thanks to:
$("#myelement").resizable();
If I remove the element from the DOM using $("#myelement").remove()
then re-add it, the resizable effect does not work anymore. I have to reinitialize it. Is there a way to keep it and not have to reinitialize it?
Thanks
Use jQuery’s
.detach()instead ofremove()The
detach()method is the same asremove(), except that .detach() keeps all jQuery data associated with the removed elements.http://api.jquery.com/detach/