title: Make javascript variable equal to input checkbox
body: <p>Imagine I have an input like so:</p>
  
  <pre><code>&lt;input id="submitCheckbox" type="checkbox" name="recieveEmails"&gt;
  </code></pre>
  
  <p>And some form of submit button, say;</p>
  
  <pre><code>&lt;button id="submit" type="button" onclick="submit()"&gt;&lt;/button&gt;
  </code></pre>
  
  <p>And Javascript like so:</p>
  
  <pre><code>function submit() {
      var newVar = document.getElementById("submitCheckbox");
  }
  </code></pre>
  
  <p>And by using something like this, <code>newVar</code> would be equal to <code>True</code> or <code>False</code> depending on the status of the checkbox when the submit button is pressed?</p>
  
  <p>PS. The Javascript example I provided is theoretical. Please don't rip into me because it "doesn't work"</p>