title: How to detect the background color changed event Using jquery?
body: <p>Hi this is my html structure.</p>
  
  <pre><code>  &lt;div class="test-class" style="background-color: red;" &gt;1&lt;/div&gt;
    &lt;div class="test-class" style="background-color: blue;" &gt;1&lt;/div&gt;
    &lt;div class="test-class" style="background-color: green;" &gt;1&lt;/div&gt;
  </code></pre>
  
  <p>Here on first page load the background-color of test-class come randomly . </p>
  
  <p>i want to run  an function when the background color of test-class is changed . How to do this ?</p>
  
  <blockquote>
    <p>Edit</p>
  </blockquote>
  
  <p>so from <a href="https://stackoverflow.com/questions/2157963/is-it-possible-to-listen-to-a-style-change-event">Is it possible to listen to a &quot;style change&quot; event?</a> this question i got  a solution</p>
  
  <pre><code>(function() {
      var ev = new $.Event('style'),
          orig = $.fn.css;
      $.fn.css = function() {
          $(this).trigger(ev);
          return orig.apply(this, arguments);
      }
  })();
  
  $('.test-class').bind('style', function(e) {
      console.log( $(this).attr('style') );
  });
  </code></pre>
  
  <p>But please help to apply this answer .
  i want to alert the content of that div and it's color when it's background-color is changed .</p>