title: How do you get a Radio Button to change text color in html with jquery?
body: <p>Here is the code I Have cant figure out how to get the value of the radio button to be read by jquery and then into a function that will then change the color of the text.</p>
  
  <p>Code: <a href="https://jsfiddle.net/RhnvU/3898/" rel="nofollow">https://jsfiddle.net/RhnvU/3898/</a></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;span id="quotechange"&gt; HEllloooooo &lt;/span&gt;
  
  &lt;div id="mydiv"&gt;
                  Color: 
                      &lt;label class="color1"&gt;&lt;input type="radio"  name="color" value="color1" checked="checked"&gt;Black&lt;/label&gt;
                      &lt;label class="color2"&gt;&lt;input type="radio"  name="color" value="color2" &gt;Purple&lt;/label&gt;
                      &lt;label class="color3"&gt;&lt;input type="radio"  name="color" value="color3" &gt;Orange&lt;/label&gt;
                      &lt;label class="color4"&gt;&lt;input type="radio"  name="color" value="color4" &gt;Red&lt;/label&gt; &lt;br&gt;
  
                  Style:
                      &lt;label class="stylebold"&gt;&lt;input type="checkbox" name="style1" value="stylebold" &gt; Bold&lt;/label&gt;
                      &lt;label class="styleitalic"&gt;&lt;input type="checkbox" name="style2" value="styleitalic" &gt; Italic&lt;/label&gt;
             &lt;/div&gt;
  </code></pre>
  
  <p>CSS:</p>
  
  <pre><code>.color1 {
      color: black;
  }
  .color2 {
      color: purple;
  }
  .color3 {
      color: orange;
  }
  .color4 {
      color: red;
  }
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>$('#mydiv input').click(colorClick($('input[name=color]:checked', '#mydiv').val()));
  
  
  function colorClick(color) {
      if(color == "color1") {
          $("#quotechange").removeClass("color2");
          $("#quotechange").removeClass("color3");
          $("#quotechange").removeClass("color4");
          $("#quotechange").addClass("color1");
      }
      else if(color == "color2"){
          $("#quotechange").removeClass("color1");
          $("#quotechange").removeClass("color3");
          $("#quotechange").removeClass("color4");
          $("#quotechange").addClass("color2");
      }
      else if(color == "color3"){
          $("#quotechange").removeClass("color1");
          $("#quotechange").removeClass("color2");
          $("#quotechange").removeClass("color4");
          $("#quotechange").addClass("color3");
      }
      else if(color == "color4"){
          $("#quotechange").removeClass("color1");
          $("#quotechange").removeClass("color3");
          $("#quotechange").removeClass("color2");
          $("#quotechange").addClass("color4");
      }
  }
  </code></pre>