title: Is it possible to use multiple for loop at same time?
body: <p>I want to create a html form, it have 2 group(Name and fruit), each group have two check boxes, When user clicks the checkbox that input name are user_checkbox[] and fruit_checkbox[] , its will do something,i need to use array and for loop to get the user which group of checkboxes was checked , but it seems not to allow me use multiple for loop.
  My Html File    </p>
  
  <pre><code>//group1
  &lt;input name="user_checkbox[]" type="checkbox" value="Peter" onclick="showinputtext();" &gt;Peter
  &lt;input name="user_checkbox[]" type="checkbox" value="Billy" onclick="showinputtext();" &gt;Billy
  //group2
  &lt;input name="fruit_checkbox[]" type="checkbox" value="Apple" onclick="showinputtext();" &gt;Apple
  &lt;input name="fruit_checkbox[]" type="checkbox" value="Banner" onclick="showinputtext();" &gt;Banana
  </code></pre>
  
  <p>My Javascript file</p>
  
  <pre><code>    function showinputtext() {
      var name = document.getElementsByName("user_checkbox[]");
      var fruit = document.getElementsByName("fruit_checkbox[]");     
  
        for (var n = 0; n &lt; name.length; n++) &amp;&amp; for (var f = 0; f &lt; fruit.length; f++)  { 
      if(name[n].checked &amp;&amp; fruit[f].checked){
      dosomething..................
        }
  }
  </code></pre>
  
  <p>but it is not work for me, any idea?? thx</p>