Each time you attach a listener, create an object of the event name and callback function; push this object onto the end of an array. When you want to detach all events you can pop each element off the array and call the appropriate function to remove the listener.
You could also save the content of the DOM container, destroy and recreate it, and replace the content.
Each time you attach a