title: jQuery cloned element and it's child button click event fires multiple times
body: <p>I have some code to <a href="http://api.jquery.com/clone/" rel="nofollow"><code>clone</code></a> a table row:</p>
  
  <pre><code>// Clone existing row and make it a template row
  var clone = $('table tbody tr:last').clone();
  clone.insertBefore('table tbody tr:first');
  clone.find('.edit').click();
  </code></pre>
  
  <p>As you see I want to fire the <code>click</code> event of a <code>&lt;button&gt;</code> with class <code>.edit</code>.</p>
  
  <p>The <code>click</code> event is like this:</p>
  
  <pre><code>$('body').on('click', '.edit, .cancel', function(e)
  {
      e.preventDefault();
  
      // Do something here...
  });
  </code></pre>
  
  <p>The user clicks a dialog's close button and then I remove the table's container with <code>$(".widget-container").remove();</code>. Later on this container can be recreated if the user opens the dialog again - if this happens the container and the table are once again inserted into the DOM.</p>
  
  <p>This is the code I use to load the dialog and it's HTML:</p>
  
  <pre><code> $.ajax({
           url: 'getDialogUrl',
           type: 'GET',
           cache: false,
           success: function(html)
           {
               $(html).insertAfter('.someOtherExistingDOMElement');
  
               ....
           }
  </code></pre>
  
  <p>The problem is that in this second time, when <code>clone.find('.edit').click();</code> is called it fires the <code>click</code> event twice. If I close the dialog and reopen it again, the click is fired 3 times and so on...</p>
  
  <p>I thought that <a href="http://api.jquery.com/remove/" rel="nofollow"><code>remove</code></a> would clear all events bound to the elements that got removed from the DOM. Looks like this is not happening. </p>
  
  <p>I guess I'm cloning it wrongly. I tried <code>.clone(false)</code> and <code>.clone(false, false);</code> but it kept the same behavior.</p>
  
  <p>Why is this happening? Any ideas about what I'm doing wrong here?</p>