Redify jQuery Plugin

Building a simple jQuery plugin to color the selected elements to red

by Muhammad Ikhsan

HTML

<p class="red">
  This should be red
</p>
<p class="notred">
  This shouldn't be red
</p>
<p class="red">
  This should be red
</p>

JavaScript

(function($) {
  var shade = '#ff0000';
  $.fn.redify = function() {
    this.css('color', shade);
    return this;
  };
}(jQuery));

$('.red').redify();