title: Compare element value with current date
body: <p>I'm working on a JavaScript function trying to get the value from <code>span</code> and compare that value with today's <code>date</code></p>
  
  <p>The logic is : </p>
  
  <p>If span date is more than 30 days, change it's background color to <strong>green</strong></p>
  
  <p>If span date is more than 60 days, change it's background color to <strong>blue</strong></p>
  
  <p>If span date is more than 90 days, change it's background color to <strong>red</strong></p>
  
  <p>My span currently is :</p>
  
  <pre><code>&lt;span class="awsome"&gt;02/04/2011&lt;/span&gt;
  var s =`$('.awsome span').text();`    
  alert(s);
  </code></pre>
  
  <p>I want to compare it with :</p>
  
  <pre><code>var d = new Date();
  var strDate = d.getFullYear() + "/" + (d.getMonth()+1) + "/" + d.getDate();
  </code></pre>
  
  <p>My question is how do I compare and change the color at the same time ?</p>