title: Do I need to unbind jquery event before remove element?
body: <p>I have a page using jquery-ui-dialog.  Each time the dialog opens, page contents load in  using ajax. Then it binds some event using jquery "on()".
  When the dialog close, it will empty its content.</p>
  
  <p><strong>The question is</strong>, do I need to unbind the events on ".ajax-content" before $.empty()?</p>
  
  <p><em><strong>edit</em></strong>:
  <strong>concern 1.</strong> any possible degrade JS performance? if I empty() hundreds of nodes this way.</p>
  
  <p><em><strong>concern 2.</em></strong> would remove element also remove events from memory(or whatever execution/evaluation chain of jquery)?</p>
  
  <p>I am not doing anything to them for now.
  If the dialog open/close for many times without page refresh, would it cause any problem?</p>
  
  <p>Code look like this:</p>
  
  <pre><code>&lt;div id="jquery-dialog" class="container"&gt;
    &lt;div class="ajax-content"&gt;
      some buttons....
    &lt;/div&gt;
  &lt;/div&gt;
  
  ------after each ajax load------------
  $(".ajax-content").on("click", ".button", function(event) {
    //handles the click
  });
  
  ------on dialog close------------
  $("#jquery-dialog").empty();
  </code></pre>