title: jQuery click event not working on second page of the table
body: <p>I have a table using bootstrap with pagination. In this table I have Action column consisting a delete button. I am using jQuery click event to do the action. In the first page of table, it is functioning normally but when I go to second page, this function is not working. Below are my codes.</p>
  
  <pre><code>&lt;div class="container"&gt;
      &lt;div class="body"&gt;
          &lt;div class="content"&gt;
              &lt;table id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%"&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th width="4%"&gt;S.N.&lt;/th&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Address&lt;/th&gt;
                      &lt;th width="8%"&gt;Modified Date&lt;/th&gt;
                      &lt;th width="24%"&gt;Action&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                  &lt;?php 
                  $sn = 1;
                  foreach ($rows as $result) {
                      ?&gt;
                      &lt;tr id=&lt;?= $result['id'];?&gt;&gt;
                          &lt;td&gt;&lt;? echo $sn++; ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;? echo $result['name'] ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;? echo $result['Address'] ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;? echo $result['modified_date'] ?&gt;&lt;/td&gt;
                          &lt;td&gt;
                              &lt;?php &lt;a href="delete.php?id=&lt;?php $result['id']; ?&gt;" class="btn btn-danger btn-xs"&gt;&lt;span class="glyphicon glyphicon-trash" aria-hidden="true"&gt;&lt;/span&gt;Delete&lt;/a&gt;?&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;?php } ?&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      $('.btn-danger').on('click', function(event) {
          event.preventDefault();
          alert(2);
      });
  });
  &lt;/script&gt;
  </code></pre>