title: Are JavaScript event listeners cleaned up automatically?
body: <p>After an element is removed from the DOM, will its event listeners automatically be unregistered and their referenced resources (closures) cleaned up? If yes, will the answer change if some non-event listener code holds a reference to the element?</p>
  
  <p>My specific concern relates to "pseudo-navigation" where the <code>unload</code> event is fired and most of the document is replaced (and of course many replacement elements also register event listeners), but there might be several pseudo-navigations before another full-page load occurs. So I'm wondering whether it's necessary to track all added event listeners and remove them manually when <code>unload</code> fires to avoid leaking any resources they reference.</p>
  
  <p>(Notes: In my case, "use jQuery/[other js library] to handle it" isn't a valid solution. I'm interested in compatibility with IE8+ and reasonably new versions of other browsers.)</p>