title: Jquery Not working on the second page of the datatable
body: <blockquote>
    <p>This is the html for the question, issue is basically when i click on the userimage class on the first page of the datatable then it works fine but when i click on the second page of the datatable then the even is not fired.</p>
  </blockquote>
  
  <pre><code>&lt;table class="table" id="example1"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;S.No.&lt;/th&gt;
        &lt;th&gt;Name&lt;/th&gt;
        &lt;th&gt;Email&lt;/th&gt;
        &lt;th&gt;Contact&lt;/th&gt;
        &lt;th&gt;Action&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;?php 
        $i = 0;
        foreach($users as $user){
          $i++;
          $id = $user['id'];
          $btn_class = ($user['status'] ==1 ? "btn btn-success" : "btn btn-warning");
          $url_attribute = ($user['status'] ==1 ? "user-disable" : "user-enable");
          $btn_text = ($user['status'] ==1 ? "Disable" : "Enable");
          $picture = $_SERVER['DOCUMENT_ROOT']. "/temp/assets/images/user_profile/". $user['image'];
          $user_profile_pic = (file_exists($picture) &amp;&amp; $user['image'] != "" ? base_url()."/temp/assets/images/user_profile/". $user['image'] : ($user['social_image'] ? $user['social_image'] : ""));
          ?&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;?= $i;?&gt;&lt;/td&gt;
  </code></pre>
  
  <blockquote>
    <p>This is the userimage class on which click event is fired.</p>
  </blockquote>
  
  <pre><code>          &lt;td &lt;?php if($user_profile_pic != ""){ ?&gt; class="userimage" data-userimage="&lt;?= $user_profile_pic;?&gt;"&gt;
              &lt;a data-toggle="modal" data-target="#myModal" href="" &lt;?php } ?&gt;&gt;
              &lt;?= ($user['fulname'] ? $user['fulname'] : "N/A"); ?&gt;&lt;/a&gt;
            &lt;/td&gt;
            &lt;td&gt;&lt;?= ($user['email'] ? $user['email'] : "N/A");?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;?= ($user['contact'] ? $user['contact'] : "N/A");?&gt;&lt;/td&gt;
            &lt;td&gt;
              &lt;a href="&lt;?= base_url().'admin/user-view/'.$id;?&gt;" class="btn btn-info"&gt;View Detail&lt;/a&gt;
              &lt;a href="&lt;?= base_url().'admin/user-delete/'.$id;?&gt;" class="btn btn-danger" onclick="return confirm_delete();"&gt;Delete&lt;/a&gt;
              &lt;a href="&lt;?= base_url().'admin/'.$url_attribute.'/'.$id;?&gt;" class="&lt;?= $btn_class;?&gt;"&gt;&lt;?= $btn_text;?&gt;&lt;/a&gt;      
            &lt;/td&gt;
          &lt;/tr&gt;
        &lt;?php 
        } 
      ?&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <blockquote>
    <p>This is the JavaScript code.</p>
  </blockquote>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function confirm_delete(){
      var x = confirm("Are You Sure, you want to delete this User ?");
      if(x){
        return true;
      }else{
        return false;
      }
    }
  
    $("#example1").DataTable();
  
    $(".userimage").click(function(){
      var image = $(this).attr('data-userimage');
      var name = $(this).text().toUpperCase();
      $("#image").show();
      $("#image").attr('src',image);
      $("#fulname").text(name);
    })
  &lt;/script&gt;
  </code></pre>