title: Change color of label using jquery?
body: <p>I wanted to change the color of the label to Red on button click </p>
  
  <p>However the code isn't working everything seems to be right </p>
  
  <pre><code>    &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;
      &lt;/title&gt;
      &lt;script type="text/javascript"&gt;
      function changeColor(id, newColor) {
  
  var labelObject = document.getElementById(id);
  
  $("#" + id).css("color", newColor);
  
  }
      &lt;/script&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;form id="frm2"&gt;
  
  &lt;label for="model"&gt;Male&lt;/label&gt;
  
  &lt;input type="text" name="cars" id="model" /&gt;
  
  &lt;br /&gt;
  
  &lt;label for="female"&gt;Female&lt;/label&gt;
  
  &lt;input type="text" name="cars" id="color" /&gt;
  
  &lt;/form&gt;
  
  &lt;input type="button" value="Change Label Color" onclick="return changeColor('label', 'red')" /&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help</p>