title: How to get the values of all checked checkboxes using jQuery
body: <p>I don't know how to pass the selected values of the checkboxes. Any help or suggestions will be a big help for me.</p>
  <p>As of now here is my code I am stuck in passing the values of the checkboxes</p>
  <h3><code>index.php</code></h3>
  <pre><code>&lt;table&gt;
  &lt;?php
  foreach($response as $item){
      echo '&lt;tr&gt;&lt;td&gt;&lt;input type=&quot;checkbox&quot; value=&quot;' .$item['id']. '&quot;&gt;&lt;/td&gt;&lt;td&gt;' . $item['name'] . '&lt;/td&gt;&lt;/tr&gt;';
  }
  ?&gt;
  &lt;/table&gt;
  &lt;button type=&quot;button&quot; class=&quot;btnadd&quot;&gt;AddSelected&lt;/button&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
      $(function() {
          $('.btnadd').click(function() {
              $.ajax({
                  url: 'process.php',
                  type: 'post',
                  data: {  }, // what should I put here to pass the value of checked checkboxes
                  success: function(data) {}
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  <h3><code>process.php</code></h3>
  <pre><code>&lt;?php
  $array_ids = $_POST['ids']; // this will retrieve the id's
  ?&gt;
  </code></pre>