title: Dynamically check if the checkbox is checked on-fly
body: <p>I have two div tag which contains a <code>series of checkboxes</code>. I would like to know whether one of the them is checked or not.</p>
  
  <pre><code>&lt;div id="doctor" class="doctor"&gt;
     Doctor
     &lt;input type="checkbox" id="doctor0" name="I am 22" value="I am 22"&gt;
     &lt;label for="I am 22"&gt;I am 22&lt;/label&gt;&lt;br&gt;
     &lt;input type="checkbox" id="doctor1" name="I have a cough" value="I have a cough"&gt;
     &lt;label for="I have a cough"&gt;I have a cough&lt;/label&gt;
  &lt;/div&gt;
  
   &lt;div id="patient" class="patient"&gt;
     Patient
     &lt;input type="checkbox" id="patient0" name="I am Patient" value="I am patient"&gt;
     &lt;label for="I am patient"&gt;I am patient&lt;/label&gt;&lt;br&gt;
     &lt;input type="checkbox" id="patient1" name="I have a cough" value="I have a cough"&gt;
     &lt;label for="I have a cough"&gt;I have a cough&lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have these two div tags which contain a series of a dynamically generated checkbox. I would like to get if either one of these is checked or both of them is checked. </p>
  
  <ol>
  <li>Check if one item or more item is checked under Doctor. </li>
  <li>Check if one item or more item is checked under patient.</li>
  </ol>
  
  <p>If both are true, do something. 
  If only one of the item is checked, do something.</p>
  
  <p>Code: </p>
  
  <pre><code>function getItem(event) {
    console.log(event.target.checked)
  }
  </code></pre>
  
  <p>I am able to get whether its checked or not, but not sure how the particular item is checked or not. I don't want to manually access the dom elements. </p>
  
  <pre><code>if(document.getElementById("doctor0").checked || document.getElementById("patient0").checked)
  </code></pre>