title: alert multiple checkbox values
body: <p>i am submitting data through <code>FormData</code> and i am trying to alert values of check boxes which are checked in my form, right now i am able to make it work for only one check box. </p>
  
  <p>how can i alert values of all those check boxes which are checked.</p>
  
  <pre><code>var formData = new FormData(document.getElementById("update-form"));
  
  $("#myCheckbox1").on('change',function(){
      if($("#myCheckbox1").is(':checked'))
          $('#hiddenInput1').val(1);
      else{
           $('#hiddenInput1').val(0);
      }
  });
  alert(
      $('#hiddenInput1').val()
  );
  </code></pre>
  
  <p><strong>Check Box 1:</strong> </p>
  
  <pre><code>&lt;input type="hidden" value="0" name="visa" id="hiddenInput1"&gt;
  &lt;input type="checkbox" value="1" id="myCheckbox1"&gt;
  </code></pre>
  
  <p><strong>Example Check Box 2:</strong></p>
  
  <pre><code>&lt;input type="hidden" value="0" name="visa1" id="hiddenInput2"&gt;
  &lt;input type="checkbox" value="1" id="myCheckbox2"&gt;
  </code></pre>
  
  <p>How to Alert Values of all check boxes which are checked in FormData without repeating code. i found similar example online but none were using FormData.</p>
  
  <blockquote>
    <p>Form Name is : update-form</p>
  </blockquote>