title: Replace CSS after compare today's date in Javascript
body: <p>I have this block of JS code that generates date dynamically in table cells.</p>
  
  <pre><code>'&lt;td class="dateStyleBlue" data="date"&gt;&lt;span id = "' 
  + customers.ProductID + 'date"&gt;' + util.utility( customers.GetDate) 
  + '&lt;/span&gt;&lt;/td&gt;'
  </code></pre>
  
  <p>Current CSS</p>
  
  <pre><code>.dateStyleBlue{
      color: blue;
      text-align:center;
      font-size: 10px;
  }
  </code></pre>
  
  <p>New CSS style</p>
  
  <pre><code>.dateStyleRed{
      color: red;
      text-align:center;
      font-size: 10px;
  }
  </code></pre>
  
  <p>I want to replace the Current CSS class with the New CSS if the date is past today.</p>
  
  <p>so here is what I have so far,</p>
  
  <pre><code>    var today = new Date();
  
      if (customer.GetDate &lt; today) {
         $(dateStyleBlue).replaceWith(dateStyleRed);    
      }
  </code></pre>