title: Change div background color based on text inside div
body: <p>On <a href="https://dev.infinitypxl.com/americar/" rel="nofollow noreferrer">this site</a> I have a "status tag" (Diesel, Auto, Manual, etc) on each inventory picture. I want the background color of that tag to be changed based on the text that is within the DIV.</p>
  
  <p>This is the code that I have so far:</p>
  
  <pre><code>&lt;script&gt;
  $(function() {
      var text = $('.image-container&gt;.status-tag').text().toLowerCase(), color;
      switch (text) {
       case 'Diesel':
          color = '#ff0000';
          break;
       case 'AUTO':
          color = '#6dc8bf';
          break;
       default:
          color = '#39d52d';
      }
      $('.image-container&gt;.status-tag').css('background', color);
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>The default color is showing up, but for some reason, I cannot get the specified color to show based on the text inside the div.</p>
  
  <p>This is not my own code, I found it on another thread<a href="http://jsfiddle.net/Icepickle/uJwE6/" rel="nofollow noreferrer">(original code here)</a>, but can't seem to get it to work on my site. any help would be appreciated.</p>