title: CSS won't dynamically change with .addClass() or .css()
body: <p>I have a table that has rows with different classes depending on what color it should be.  On the click of a button I want the background color of the row to change instantly.  I tried both <code>.addClass()</code> and <code>.css()</code> but they both fail. On click, I have a function that checks whether the row is colored or not, that works fine.</p>
  
  <p>Here are the pieces of code I'm using and the css classes that go along with the rows.</p>
  
  <p><strong>If a row is white:</strong></p>
  
  <p><code>$("#"+table+"_row_"+id).addClass("table-1").removeClass("table-0");</code></p>
  
  <p>or</p>
  
  <p><code>$("#"+table+"_row_"+id).css("background-color","orange");</code></p>
  
  <p><strong>If a row is orange:</strong></p>
  
  <p><code>$("#"+table+"_row_"+id).addClass("table-0").removeClass("table-1");</code></p>
  
  <p>or</p>
  
  <p><code>$("#"+table+"_row_"+id).css("background-color","white");</code></p>
  
  <p><strong>css:</strong></p>
  
  <pre><code>table.tablesorter .table-1{
  background-color:orange;
  }
  table.tablesorter .table-0{
  background-color:white;
  }
  </code></pre>