JSFiddle - React, Tailwind, and code Playground

HTML

<button id="showmenu" type="button">Show menu</button></div>
<div class="sidebarmenu">

    Can the button value change to "show" or "hide"
</div>

JavaScript

$(document).ready(function() {
$('.sidebarmenu').hide();
    $('#showmenu').click(function() {
        $('#showmenu').text($('.sidebarmenu').is(':visible') ? 'Show Menu' : 'Hide Menu');
        $('.sidebarmenu').toggle("slide");
    });
});