jQuery removing elements with event handlers
I have a list of products, where I need to update the innerHTML of a #container dynamically. My question is, if I do something like in this answer: Jquery Remove All Event Handlers Inside Element $("#container").find("*").off(); So, I remove all the event handlers for all the children, and then I update the html: $("#container").html(responseFromAJAX); How will this affect on the performance? I mean, is this a good way, to remove all the old elements and handlers, and clean up memory, or I need to do more? My app is a webshop, so my Users will look around, and update the #container maybe 30-50