title: How to get checkbox value onclick submit button?
body: <p>In this code, I have multiple checkboxes i.e. <code>name="recruiter_id"</code> with multiple submit button. Now, What happens when I click on the first row submit button it alert data but when I click on the last row submit button then it shows wrong <code>recruiter_id</code> I don't know why? So, How can I get different <code>recruiter_id</code> <code>onclick</code> different submit button? Please help me. </p>
  
  <pre><code>&lt;?php
      foreach($wishlist as $row)
      {
  ?&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="checkbox" name="recruiter_id" value="&lt;?php echo $row['rid']; ?&gt;" class="recruiter_id"&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="submit" id="&lt;?php echo $row['job_id']; ?&gt;" class="btn btn-danger job_id" value="Assign" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  &lt;?php
      }
  ?&gt;
  &lt;script&gt;
      $(document).ready(function() {
          $(".job_id").click(function(e){
              e.preventDefault();
              job_id = this.id;
              recruiter_id = $("input[name='recruiter_id']:checked").val();
              alert(job_id);
              alert(recruiter_id);
          });
      });
  &lt;/script&gt;
  </code></pre>