JSFiddle - React, Tailwind, and code Playground
HTML
<a href="#" class="button-open">Button</a>
CSS
.button-open{ color: #59a5d1;}
.button-close{ color: #c00;}
JavaScript
$(document).on('click', '.button-open', function() {
$(this).removeClass("button-open").addClass("button-close");
alert("Open Was Clicked");
});
$(document).on('click', '.button-close', function() {
$(this).removeClass("button-close").addClass("button-open");
alert("Close Was Clicked");
});