JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.jsdelivr.net/gh/fkling/jQuery-Function-Toggle-Plugin@master/jquery.func_toggle.js"></script>
<div>Click me - I'm changing colors!</div>
JavaScript
// jQuery Function Toggle demo
// See https://github.com/fkling/jQuery-Function-Toggle-Plugin
// (c) 2011 Felix Kling
$('div').funcToggle('click', function() {
$(this).css('color', 'red');
}, function() {
$(this).css('color', 'green');
}, function() {
$(this).css('color', 'black');
});