jquery catch event from a generated element : <p>I am getting data from AJAX to build a table.  This table will have a link to delete a row from the database.  I'm having trouble getting a listener to respond to a click on the generated content's "remove" link.</p>

<pre><code>&lt;!-- contribId is populated initially from PHP --&gt;
&lt;input id="hidden-contrib-id" value="&lt;?= $contribId ?&gt;" /&gt;

&lt;div id="checksEnteredContainer"&gt;
&lt;/div&gt;

&lt;script&gt;
$(document).ready(function(){

  // get data via ajax and build table
  buildCheckEnteredTable($('#hidden-contrib-id').val());

  // various listeners here...

  $('.remove_check').on('click', function() {
    alert($(this).data('contribution-id'));
  });

});

/**
 * Get checks from database
 */
function buildCheckEnteredTable(contribId) {
  var url = "/path/to/script";
  var response = $.post(url, {action: 'getChecks', contribId: contribId});

  response.done(function(result) {

    // build html table from the data
    $('#checksEnteredContainer').html(buildTable(result));
}

function buildTable(data) {
  var numberOfRows = data.length;
  var rows='';
  for(i=0; i&lt;numberOfRows; ++i) {
    rows += '&lt;tr&gt;' + 
            '&lt;td&gt;' + data[i].checkNumber + '&lt;/td&gt;' +
            '&lt;td&gt;' + data[i].amount + '&lt;/td&gt;' + 
            '&lt;td&gt;&lt;a href="#" class="remove_check" data-contribution-id="' + data[i].checkId + '"&gt;remove&lt;/a&gt;&lt;/td&gt;'
            '&lt;/tr&gt;';
  }

  var table = '&lt;table class="table"&gt;&lt;tr&gt;&lt;th&gt;Check Number&lt;/th&gt;&lt;th&gt;Amount&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;/tr&gt;' + 
              rows + 
              '&lt;/table&gt;';

  return table;
}
</code></pre>

<p>The table creation is working fine and displaying in the browser; what's not working is the listener for <code>remove_check</code> class.</p>

<p>My guess is that the newly-created table is not actually in the DOM and the listener is unaware that the table exists?  At any rate, how do I get the listener to respond to a click on the generated link?</p>
