title: Find checkboxes by value with javascript
body: <p>I have used this JavaScript to find the checkboxes I need and check them.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function checkAll(c) {
      var chks = document.getElementsByName(c.name);
      for (var i = 0; i &lt; chks.length; i++) {
          chks[i].checked = c.checked;
      }
  }
  </code></pre>
  
  <p></p>
  
  <p>But I cannot use that anymore and wonder if I could find them by their value names, lets say I have 3 checkboxes that are rendered like this.. </p>
  
  <pre><code>&lt;input name="2" type="checkbox" value="chk2" onclick="checkAll(this)"&gt;
  &lt;input name="3" type="checkbox" value="chk2" onclick="checkAll(this)"&gt;
  &lt;input name="4" type="checkbox" value="chk3" onclick="checkAll(this)"&gt;
  </code></pre>
  
  <p>If I then check one of the checkboxes with value="chk2" both of them should be checked, but no the one that have a value equals to chk3. Is this possible?</p>