title: How can I change the class of an element with jQuery?
body: <p>In my ASP.NET app I'm using AJAX and some web services to update an unknown number of instantiated user controls (hence the reason I'm using FindControl below).</p>
  
  <p>When a function returns a result, I'm trying to change the color of a label control.  This works:</p>
  
  <pre><code>$get("&lt;%= me.FindControl("lblName").ClientID %&gt;").style.color = 'red';
  </code></pre>
  
  <p>Now I would like to be able to specify the colors from a CSS file.</p>
  
  <pre><code>.MyRed 
  {
      color:Maroon;
  }
  </code></pre>
  
  <p>And here is the part I can't figure out.  I've tried using addClass and toggleClass but the browser reports "Object doesn't support property or method 'toggleClass'" etc.</p>
  
  <pre><code>$get("&lt;%= me.FindControl("lblName").ClientID %&gt;")......  = '.MyRed';
  </code></pre>
  
  <p>As always, thanks in advance!</p>