JSFiddle - React, Tailwind, and code Playground

by lollero

JavaScript

(function($){

    var defaults = {
        flags : ""
    }
        
    $.myPlugin = function(options){
        options = $.extend(true, {}, defaults, options);
        
        $.each(options.flags.split(" "), function(i, v){
            options[v] = true;
        });
    
        if ( options.one ) {
            alert("one true");
        }
        if ( !options.two ) {
            alert("two false");
        }    
        if ( !options.three ) {
            alert("three false");
        }
    
    }
 

})(jQuery);


$.myPlugin({flags: "one "});