title: Negate checkbox selection status on multiple checkboxes
body: <p>I have a big form with several checkboxes, having names chkbx0..chkbxN for them (N is known by PHP code which generates the form). I want to create a link-like entity which will invert  the checked status (so, what was checked becomes unchecked and vice versa) for all the checkboxes when it's clicked. So basically I am interested in a javascript function which has a parameter (the "N") and does the work, and I would call it something like this:</p>
  
  <pre><code>    &lt;p&gt;You can reverse checkboxes &lt;a href="javascript:chkbxsnegate(&lt;?php echo $n; ?&gt;);"&gt;by clicking here&lt;/a&gt;.&lt;/p&gt;
  </code></pre>
  
  <p>The checkboxes are something like these:</p>
  
  <pre><code>    &lt;input type="checkbox" name="chkbx0"&gt;
      &lt;input type="checkbox" name="chkbx1"&gt;
      ...
  </code></pre>
  
  <p>I use the parameter "N", because there can be more checkboxes, but I only need to invert checked status only till "N".</p>
  
  <p>Please suggest me a javascript code fragment to implement function "chkbxsnegate". Thanks a lot in advance.</p>