title: JavaScript: How to detect if an HTML checkbox was selected?
body: <p>How do I:</p>
  
  <ol>
  <li>detect if an HTML checkbox has be clicked/selected?</li>
  <li>retrieve which checkbox(es) have been selected?</li>
  </ol>
  
  <p>Example code:</p>
  
  <pre><code>&lt;FORM ACTION="..."&gt;
  &lt;INPUT TYPE=CHECKBOX VALUE="1"&gt;1 bedroom&lt;BR&gt;
  &lt;INPUT TYPE=CHECKBOX VALUE="2"&gt;2 bedrooms&lt;BR&gt;
  &lt;INPUT TYPE=CHECKBOX VALUE="3"&gt;3 bedrooms&lt;BR&gt;
  &lt;INPUT TYPE=CHECKBOX VALUE="4+"&gt;4+ bedrooms&lt;P&gt;
  &lt;/FORM&gt;
  </code></pre>
  
  <p>Meaning, </p>
  
  <ol>
  <li>if the web user selects "1 bedroom", I want an event to fire to inform me the user selected "1 bedroom".</li>
  <li>As you can see, a user can select multiple checkboxes. For example, they might want to see homes that have either "1 bedroom" or "2 bedrooms". So they would selected both checkboxes. How do I retrieve the checkbox values when multiple checkboxes have been selected?</li>
  </ol>
  
  <p>In case it helps, I would be open to using JQuery to simplify this.</p>