title: Show divs based on checkbox selection when submit button clicked
body: <p>I have a page that will have multiple checkboxes on it, the user will select some or all of the checkboxes. I then want them to click a submit button, which will show the specific divs based on the checkboxes selection. Very new to java coding and would appreciate any help. My HTML code is below.</p>
  
  <p>Thanks </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="col-md-3"&gt;
  &lt;p&gt; &lt;input name="field" type="checkbox" value="Chest X-Rays"  class="chk" /&gt;
  Chest X-Rays&lt;/p&gt;
  &lt;div class="text1" style="display:none"&gt;Important to help distinguish acute bronchitis, which should not be treated with antibiotics, from pneumonia, which should&lt;/div&gt;
  
  &lt;p&gt;&lt;input name="field" type="checkbox" value="Pulse Oximetry" class="chk" /&gt;
  Pulse Oximetry&lt;/p&gt;
  &lt;div class="text2" style="display:none"&gt;Important to assess oxygenation in patients with new complaint of dyspnea&lt;/div&gt;
  
  &lt;p&gt;&lt;input  name="field" type="checkbox" value="ECG" class="chk" /&gt;
  ECG&lt;/p&gt;
  &lt;div class="text3" style="display:none"&gt;Not unreasonable in a middle-aged patient with a moderately severe acute illness and risk factors for CAD but not an essential part of the workup&lt;/div&gt;
  &lt;p&gt;
  &lt;input name="field" type="checkbox" value="D-dimer Level" class="chk" /&gt;
  D-dimer Level&lt;/p&gt;
  &lt;div class="text4" style="display:none"&gt;Although patient has mildly decreased O2 sat, he has prominent upper respiratory symptoms and no risk factors for PE, so is not indicated&lt;/div&gt;
  &lt;p&gt;
  &lt;input name="field" type="checkbox" value="ABG" class="chk" /&gt;
  ABG&lt;/p&gt;
  &lt;div class="text5" style="display:none"&gt;Unlikely to be useful because pulse oximetry already shows degree of oxygenation and clinical findings do not suggest inadequate ventilation&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="col-md-3"&gt;
  &lt;p&gt;
  &lt;input name="field" type="checkbox" value="Serum Chemistries" class="chk" /&gt;
  Serum Chemistries&lt;/p&gt;
  &lt;div class="text6" style="display:none"&gt;Not unreasonable in a patient taking an ACE-I, which can cause renal dysfunction and hyperkalemia, particularly in a patient who may also be slightly dehydrated from his acute illness. They can also help with risk stratification of pneumonia. However, these tests are likely of low yield in someone who does not appear seriously ill and has no history of renal disease or symptoms likely to cause electrolyte disturbance&lt;/div&gt;
  &lt;p&gt;
  &lt;input name="field" type="checkbox" value="Chest CT Scan" class="chk" /&gt;
  Chest CT Scan&lt;/p&gt;
  &lt;div class="text7" style="display:none"&gt;Not indicated for acute lower respiratory infection, and patient has no risk factors for PE&lt;/div&gt;
  &lt;p&gt;
  &lt;input name="field" type="checkbox" value="Blood or Sputum Cultures" class="chk" /&gt;
  Blood or Sputum Cultures&lt;/p&gt;
  &lt;div class="text8" style="display:none"&gt;Cultures have not been shown to improve outcomes in CAP but they are helpful in patients ill enough to require hospitalization, particularly those with risk factors for unusual or resistant organisms&lt;/div&gt;
  &lt;p&gt;
  &lt;input name="field" type="checkbox" value="CBC" class="chk" /&gt;
  CBC&lt;/p&gt;
  &lt;div class="text9" style="display:none"&gt;Does not help diagnosis, treatment or disposition in any of the plausible causes&lt;/div&gt;
  &lt;p&gt;
  &lt;input name="field" type="checkbox" value="Troponin Level" class="chk" /&gt;
  Troponin Level&lt;/p&gt;
  &lt;div class="text10" style="display:none"&gt;Patient&amp;rsquo;s symptoms do not suggest acute coronary ischemia&lt;/div&gt;   
  &lt;input type="button" id="buttonClass" value="Submit" onClick="show_all();"&gt; 
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>