Here I want to suggest steps to create simple plugin with arguments.
(function($) {_x000D_
$.fn.myFirstPlugin = function(options) {_x000D_
// Default params_x000D_
var params = $.extend({_x000D_
text : 'Default Title',_x000D_
fontsize : 10,_x000D_
}, options);_x000D_
return $(this).text(params.text);_x000D_
}_x000D_
}(jQuery));_x000D_
_x000D_
$('.cls-title').myFirstPlugin({ text : 'Argument Title' });
_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>_x000D_
<h1 class="cls-title"></h1>
_x000D_
Here, we have added default object called params
and set default values of options using extend
function. Hence, If we pass blank argument then it will set default values instead otherwise it will set.
Read more: How to Create JQuery plugin