JSFiddle - React, Tailwind, and code Playground
HTML
<input type="submit" value="hide" id="btnshowhide" />
JavaScript
$(document).ready(function () {
$('#btnshowhide').click(function () {
if ($(this).val() == "hide") {
$(this).val("show");
} else {
$(this).val("hide");
}
});
});