title: Change value of checkbox based on value of other form
body: <p>I'm trying to have a checkbox called 'All' that when checked, also checks the rest of the checkboxes in my form.  I have basically no javascript experience so sorry if this is really basic.  I patched this together from looking at posts like <a href="https://stackoverflow.com/questions/5539139/change-get-check-state-of-checkbox">this</a> and <a href="https://stackoverflow.com/questions/6810182/change-checkbox-checked-value-based-upon-variable-passed-by-href">this</a>.  </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function checkIt(checkbox)
  {
    document.GetElementById("1").checked = true;
    document.GetElementById("2").click();
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>My HTML looks like this:</p>
  
  <pre><code>&lt;form&gt;
    &lt;input type="checkbox" id="A" onclick="checkIt(this)"&gt;All&lt;br&gt;&lt;/input&gt;
    &lt;input type="checkbox" id="1"&gt;One&lt;br&gt;&lt;/input&gt;
    &lt;input type="checkbox" id="2"&gt;Two&lt;br&gt;&lt;/input&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How can I get checkboxes 1 and 2 to change when I select checkbox All?  Thanks.</p>