JSFiddle - React, Tailwind, and code Playground

HTML

<div id="first" style="display:none;">first</div>
<div id="second">second</div>
<input id="btn" type="button" value="show first" />

JavaScript

$('#btn').on('click', function () {
    if ($this.val() === 'show first') {
        $('#first').show();
        $('#second').hide();
        $this.val('show second');
    } else {
        $('#first').hide();
        $('#second').show();
        $this.val('show first');
    }
});