Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nadeemelahi
Created April 11, 2014 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadeemelahi/10446070 to your computer and use it in GitHub Desktop.
Save nadeemelahi/10446070 to your computer and use it in GitHub Desktop.
if you have button with a click handler, and you remove it from dom, does the handler remain?
if you call removeChild on its parent, then the handler is gone. if you instead append it to a document fragment, it will keep it
jQuery .revome() kills the handler. jquery "detach" will keep it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment