Reply to comment

Each time you attach a

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.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options