JSFiddle - React, Tailwind, and code Playground

HTML

<form>
    <div class="option">
        <input type="checkbox" name="chkBox1" id="chkBox1" class="showHideCheck" />Click me to show the text box
        <br/><div class="hiddenInput"> Enter
        <input type="text" name="txtBox1"/></div>
    </div>
    <div class="option">
                <input type="checkbox" id="chkBox2" name="chkBox2" class="showHideCheck" />Click me to show the text box
        <br/><div class="hiddenInput">Enter
        <input type="text" name="txtBox2"/></div>
    </div>
</form>

JavaScript

$(".hiddenInput").hide();
$(".showHideCheck").on("change", function() {
    $this = $(this);
    $input = $this.parent().find(".hiddenInput");
    if($this.is(":checked")) {
        $input.slideDown();
    } else {
        $input.slideUp();
    }
});