JSFiddle - React, Tailwind, and code Playground

HTML

<button onclick="red()">Red</button>

JavaScript

$.fn.red = function() {
    return this.css( "background-color", "red" );
};
$("button").on("click", function() {
    $(this).red();
});