title: Add CSS styles via Jquery if the value from a getJSON call is a specific value
body: <p>I'm new to jquery and am hoping for a little help.</p>
  
  <p>I have a page that fetches data in <code>getJSON</code> format and inserts said data into an element on the page. The page then refreshes every 2 seconds to fetch updated data.</p>
  
  <p>Example of the element that is being updated on the page:</p>
  
  <pre><code>&lt;abbr title="mouse hover description" id="User004"&gt;..updated by getJSON..&lt;/abbr&gt;
  </code></pre>
  
  <p>Here is how I'm fetching and refreshing the content of the <code>abbr</code> element (this works): </p>
  
  <pre><code>function refreshData()
      {
          $.getJSON('http://domain.com/Data.php',function(User) {
              $.each(User, function(key, val) {
                  $('#'+key).text(val);
                });
              });
  
      }
      window.setInterval("refreshData()", 2000);
  </code></pre>
  
  <p>What I'm trying to accomplish is to:<br>
  A) Add CSS styles if the key <code>user004</code> has the value 2.<br>
  B) Add CSS styles if the key <code>user004</code> has the value and another key <code>user007</code> is 3.  </p>
  
  <p>This is what I have today for the first issue, but I know it's incorrect:</p>
  
  <pre><code>$.getJSON('http://domain.com/Data.php',function(User) {
              $.each(User, function(key, val) {
                  $('#'+key).text(val) {
                      if ($('#user004:contains("2")'))
                      {
                          $("#"+key).css({color: '#9a4d9e', cursor: 'default'});
                      }
                  }
                });
              });
  </code></pre>