JSFiddle - React, Tailwind, and code Playground
HTML
<p>Text one</p>
<p>Text two</p>
<p>Text three</p>
<p>Text four</p>
JavaScript
(function($) {
$.fn.highlite = function(options) {
return this.each(function() {
$(this).css({
"background": "yellow"
});
});
};
})(jQuery);
(function($) {
$.fn.makeRed = function(options) {
var y = this;
var x = this.each(function() {
$(this).css({
"color": "red"
});
});
if(x == y){
alert('it is the same');
}
return this;
};
})(jQuery);
$(document).ready(function() {
$('p').highlite().makeRed();
});