title: Select the checkboxes through loop?
body: <p>How i can i select the check boxes through loop ?</p>
  
  <p>For example i have 4 check boxes and if is select the 3rd check-box then 1st and 2nd also selected and if i select 4th check-box then 1st, 2nd, and 3rd also got selected.</p>
  
  <p>Any hint about this in jquery , java script or any other language?</p>
  
  <p>help will be appreciated...........</p>
  
  <p>HTML Code</p>
  
  <pre><code>&lt;form&gt;
  &lt;div&gt;
      &lt;input type="checkbox" name="option-1" id="option-1"&gt; &lt;label for="option-1"&gt;Option 1&lt;/label&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;input type="checkbox" name="option-2" id="option-2"&gt; &lt;label for="option-2"&gt;Option 2&lt;/label&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;input type="checkbox" name="option-3" id="option-3"&gt; &lt;label for="option-3"&gt;Option 3&lt;/label&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;input type="checkbox" name="option-4" id="option-4"&gt; &lt;label for="option-4"&gt;Option 4&lt;/label&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;input type="checkbox" name="option-5" id="option-5"&gt; &lt;label for="option-5"&gt;Option 5&lt;/label&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;input type="submit"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>