JSFiddle - React, Tailwind, and code Playground
by JM note
HTML
<script src="//code.jquery.com/jquery.min.js"></script>
<script>
// 플러그인
(function ( $ ) {
$.fn.highlight = function( options ) {
var settings = $.extend({
color: "red",
backgroundColor: "yellow"
}, options );
return this.css({
color: settings.color,
backgroundColor: settings.backgroundColor
});
};
}( jQuery ));
// 사용 예시
$(function() {
$('.box1').highlight();
$('.box2').highlight({
backgroundColor: 'white'
});
$('.box3').highlight({
color: 'yellow',
backgroundColor: 'green'
});
});
</script>
<div class='box1'>한놈</div>
<div class='box2'>두시기</div>
<div class='box3'>석삼</div>