title: Can't change css property after ajax call
body: <p>I'm doing an ajax call an trying to add a class to a DOM element, and then change a value of a property of that class.</p>
  
  <p>I can add the class, but not changing the attribute.</p>
  
  <pre><code>&lt;script&gt;
  function load_to_be_analysed_count() {
      $.ajax({
          url: 'experiments/to_be_analysed/count',
          dataType: 'text',
          type: 'get',
          success: function(data) {
              // data is the number of experiments to be analysed, returned from server
              if (data &gt;= 0) {
                  $('#new_experiments').addClass('badger');
                  console.log($('.badger').css('content'));  // DEBUG
                  $('.badger').css('content', data);
              }
          },
          error: function () {
              $('#login-language').html('&lt;p&gt;An error ocurred&lt;/p&gt;'); // TODO: just for debug. Maybe console.log
          }
      });
      if ($('#new_experiment').hasClass('badger')) {
          $('.badger')
      }
  }
  $(function () {
      load_to_be_analysed_count()
  })
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>HTML before:</strong></p>
  
  <pre><code>&lt;i id="new_experiments" class="fa fa-bell fa-2x icon-grey"&gt;&lt;/i&gt;
  </code></pre>
  
  <p>When I load the page, Inspector display <code>none</code> when <code>console.log($('.badger').css('content'));  // DEBUG</code> is reached.</p>
  
  <p>In Inspector, I can see the above HTML changed to</p>
  
  <p><strong>HTML after:</strong></p>
  
  <pre><code>&lt;i id="new_experiments" class="fa fa-bell fa-2x icon-grey badger" style=""&gt;&lt;/i&gt;
  </code></pre>
  
  <p><strong>CSS:</strong></p>
  
  <pre><code>i#new_experiments {
    width: 50px;
    text-align: center;
    vertical-align: middle;
    position: relative;
  }
  .badger:after{
      content: "50";
      position: absolute;
      background: red;
      height: 2rem;
      top: -0.2rem;
      right: 0.2rem;
      width: 2rem;
      text-align: center;
      line-height: 2rem;
      font-size: 1rem;
      border-radius: 50%;
      color: white;
  }
  </code></pre>