JSFiddle - React, Tailwind, and code Playground

HTML

<form>
    <fieldset>
        <legend>Test fieldset</legend>
        <input type="text" />
        <input type="text" />
    </fieldset>
</form>

JavaScript

$(function (){
    $(document).on('click', 'legend', function() {
        var content = $(this).siblings();
        content.slideToggle('slow');
    });
});