title: Javascript: How can I get all value of selected checked checkboxes, push to an array then put in in a input HTML element?
body: <p>I have a list of 50 checkboxes. If users check some of them, how can I get all values of the selected ones and push them into an array then place it in a hidden text element?</p>
  
  <p>Can I use the same name for all checkboxes? or I must use different name for each of them?</p>
  
  <pre><code>&lt;input type="checkbox" name="bulk_id[]" value="1"/&gt;
  &lt;input type="checkbox" name="bulk_id[]" value="2"/&gt;
  &lt;input type="checkbox" name="bulk_id[]" value="3"/&gt;
  &lt;input type="checkbox" name="bulk_id[]" value="4"/&gt;
  &lt;input type="checkbox" name="bulk_id[]" value="5"/&gt;
  ...
  </code></pre>
  
  <p>Thank you.</p>