title: Change background color invert text jQuery
body: <p>I found some promising code to do random background css color and invert the text color but can not seem to get this to work. Any help is greatly appreciated.</p>
  
  <pre><code>$(document).ready(function() {
  var colors = ['#000000', '#FF3516', '#34FF17', '#2458FF'];
  function UpdateColors() {
      $(this).each(function(index) {
          var color = colors[Math.floor(Math.random() * colors.length)];
          var invertedColor = invertColor(color);
          $(this).css({
              'background-color': color,
              'color': invertedColor
          });
      });   
  }
  //$('div').UpdateColors();
  });
  </code></pre>
  
  <p>Fiddle here: </p>
  
  <p><a href="https://jsfiddle.net/abennington/h49zh3gy/10/" rel="nofollow">https://jsfiddle.net/abennington/h49zh3gy/10/</a></p>