When emptying a tag, do the event-attached-buttons inside get garbage collected?
<p>Having a code like this, I'm wondering if I ran this function a second time, which scenario will happen:</p>

<ol>
<li>When emptying the #deals tag, all <code>btn</code> inside will get wiped as well despite the event on them and life is good.</li>
<li>I have to unsubscribe from those <code>btn</code> first, otherwise emptying the <code>#deals</code> tag leads to a memory leak? </li>
<li>List item</li>
</ol>

<p>Code:</p>

<pre><code>function test(){
    var row = $(this).closest('tr');  
    $(row).find('#deals').empty();

    $(result).find('#tab li a').each(function() {               
      var btn = $('&lt;a/&gt;', {class: 'btn', href: '#'});

      $(row).find('#deals').append(btn);

      btn.click(function(event){
          event.preventDefault();
          ...
         });
    });
}
</code></pre>
