title: Validating Multiple Groups of Radio Buttons - Javascript Only
body: <p>I'm trying to validate multiple groups of radio buttons at the same time. I'm having trouble not only validating them but also getting the error in the divs to show up as well. When the option is selected I want the validate and save the value so I can save the value in local storage later. (At this moment I don't want to print it I just want to validate by value and make sure something is selected)  I'm not sure what I'm doing wrong, here is my code:  <a href="https://jsfiddle.net/7ace6uws/" rel="nofollow noreferrer">https://jsfiddle.net/7ace6uws/</a></p>
  
  <p>Since I was not able to post just the jsfiddle and needed to accompany code as well here is my HTML:</p>
  
  <pre><code>&lt;tr&gt;
    &lt;td&gt;&lt;label&gt;Whats your favorite color:&lt;/label:&gt;
    &lt;/td&gt;
    &lt;div id="color"&gt;&lt;/div&gt;
    &lt;td&gt;
      &lt;fieldset id="group1"&gt;
        &lt;input type="radio" value="blue" name="color"&gt;Blue
        &lt;input type="radio" value="red" name="color"&gt;Red
        &lt;div&gt;
  
        &lt;/div&gt;
      &lt;/fieldset&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
    &lt;td&gt;&lt;label&gt;What is your favorite food:&lt;/label&gt;&lt;/td&gt;
    &lt;div id="food"&gt;&lt;/div&gt;
    &lt;td&gt;
      &lt;fieldset id="group2"&gt;
        &lt;input type="radio" id="pizza" name="food"&gt;Pizza
        &lt;input type="radio" id="cake" name="food"&gt;Cake
      &lt;/fieldset&gt;
    &lt;/td&gt;
  
  &lt;/tr&gt;
  
  &lt;tr&gt;
    &lt;td&gt;&lt;label&gt;Do you go to school:&lt;/label&gt;&lt;/td&gt;
    &lt;div id="school"&gt;&lt;/div&gt;
    &lt;td&gt;
      &lt;fieldset id="group3"&gt;
        &lt;input type="radio" id="yes" name="school"&gt;Yes
        &lt;input type="radio" id="no" name="school"&gt;No
      &lt;/fieldset&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
  &lt;input type="button" value="Save" onclick="validateForm();" /&gt;
  </code></pre>
  
  <p><strong>Note on possible duplicate:</strong> I know this question has been asked before. I've read the answers on similar questions but I'm still lost. For some of the answers I was having trouble understanding the Javascript since they used something called template literals. Some answers also used jQuery which I also haven't learned yet. Some answers also used formData (<a href="https://developer.mozilla.org/en-US/docs/Web/API/FormData" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/API/FormData</a>) but I haven't learned this yet either so I'm trying to write the code using what I know so far which is basic javascript.</p>