JSFiddle - React, Tailwind, and code Playground

HTML

<button>Show/Hide form</button>

<fieldset>
<legend></legend>
Name: <input type="text" /><br />
Email: <input type="text" /><br />
Date of birth: <input type="text" />
</fieldset>
<br />
<button>Show/Hide form</button>
<fieldset>
<legend></legend>
Name: <input type="text" /><br />
Email: <input type="text" /><br />
Date of birth: <input type="text" />
</fieldset>
<br/>
<button>Show/Hide form</button>
<fieldset>
<legend></legend>
Name: <input type="text" /><br />
Email: <input type="text" /><br />
Date of birth: <input type="text" />
</fieldset>

JavaScript

$(function(){
    $('button').click(function(){  
            if( $(this).html()=='Show/Hide form') $(this).html('Hide');
        $(this).nextAll('fieldset:first').toggle();
        
        $(this).html()=='Show'?($(this).html('Hide')):($(this).html('Show'));
    });
})