title: How to call Jquery button on click?
body: <p>In my html I have the following ajax code which populate data into a table:</p>
  
  <pre><code>function generate_table() {
  
        var tr;
        $('#emp_body').html('');
        for (var i = 0; i &lt; displayRecords.length; i++) {
          tr = $('&lt;tr/&gt;');
          tr.append("&lt;td&gt;" + displayRecords[i].id + "&lt;/td&gt;");
          tr.append("&lt;td&gt;" + displayRecords[i].email_address + "&lt;/td&gt;");
          tr.append("&lt;td&gt;" + displayRecords[i].mobile_number + "&lt;/td&gt;");
          tr.append("&lt;td&gt;" + displayRecords[i].status + "&lt;/td&gt;");
          tr.append("&lt;td&gt;" + displayRecords[i].credit_limit + "&lt;/td&gt;");
          var $td = $('&lt;td&gt;').html('&lt;a href="#" class="btn btn-info btn-md editbtn"&gt;Edit&lt;/a&gt;');
          tr.append($td);
          $('#emp_body').append(tr);
        }
      }
  </code></pre>
  
  <p>I also have a jquery on click function:</p>
  
  <pre><code>jQuery('.editbtn').on('click', function() {
  
        var $row = jQuery(this).closest('tr');
        var $columns = $row.find('td');
        var values = [];
  
        jQuery.each($columns, function(i, item) {
            values.push(item.innerHTML)
        });
        console.log(values[0]);
        window.location.href = "/portal/admin/customerDetails?id=" + values[0];
  
      });
  </code></pre>
  
  <p>So the issue here is that, when I click on Edit button, it does not call the on click function. How can I fix this issue ? </p>