JSFiddle - React, Tailwind, and code Playground

by Prasad Gavande

HTML

<p id="firstPara">hello this is first paragraph</p>

JavaScript

//chnge color with option functionality
var col = prompt("enter color");
(function ($) {

    $.fn.greenify = function (options) {

        // This is the easiest way to have default options.
        var settings = $.extend({
            // These are the defaults.
            color: "#556b2f",
            backgroundColor: "white"
        }, options);

        // Greenify the collection based on the settings variable.
        return this.css({
            color: settings.color,
            backgroundColor: settings.backgroundColor
        });

    };

}(jQuery));

$("p").greenify({

    color: col
});