JSFiddle - React, Tailwind, and code Playground
by somsekhardash
HTML
<body>
<p class="somi"> i am a good boy </p>
</body>
JavaScript
$(function() {
$.fn.mystyle = function( options ) {
// default value
var defaults={
textColor : "yellow" ,
textDeco : "underline",
backColor : "red",
fontSize : 19
};
// assigning to a variable
var setting = $.extend( {} , $.fn.mystyle.defaults , options );
// returing the value
return this.css({
color : setting.textColor,
backgroundColor : setting.backColor,
textDecoration : setting.textDeco,
fontSize : setting.fontSize
});
};
});
$( document ).ready(function() {
$(".somi").mystyle({
textColor: "orange",
});
});