JSFiddle - React, Tailwind, and code Playground
HTML
<button id="show">Show</button>
JavaScript
$("#show").click(function () {
if($(this).text() == "Show") {
$(this).text("Hide");
alert("Fill fields");
} else {
$(this).text("Show");
alert("Clear fields");
}
});