JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<label id="clickMe">Show</label>
<br />
<div id="textBox" style="display: none">This text will be toggled</div>

JavaScript

$('#clickMe').toggle(
            function(){
                $('#textBox').show();
                $('#clickMe').text('hide');
            },
            function(){
                $('#textBox').hide();
                $('#clickMe').text('show');
            });