JSFiddle - React, Tailwind, and code Playground

HTML

<form id="chooseForm">
    <input type="checkbox" name="form1" value="form1"> Form1<br>
    <input type="checkbox" name="form1" value="form2"> Form2<br>
</form>

<form id="form1" class="formGroup">
    <h2>FORM 1</h2>
    <label>Name</label><input type="text"> <br>
    <label>Address</label><input type="text">
</form>

<form id="form2" class="formGroup">
    <h2>FORM 2</h2>
    <label>Username</label><input type="text"> <br>
</form>

JavaScript

$(".formGroup").hide();
$('#chooseForm input:checkbox').on('change', function() {
    if($(this).is(':checked')) {
        $("#" + $(this).val()).show();
    }
    else {
        $("#" + $(this).val()).hide();
    }   
});