JSFiddle - React, Tailwind, and code Playground
HTML
<fieldset>
<div class="item" id="drinks">
<input name="drinks" id="hot" type="radio" value="hot" />
<label for="hot">Hot</label>
</div>
<div class="item" id="drinks">
<input name="drinks" id="cold" type="radio" value="cold" />
<label for="cold">Cold</label>
</div>
<fieldset class="hot">
echo value;
</fieldset>
</fieldset>
CSS
fieldset > fieldset {
display:none;
}
fieldset > fieldset.active {
display:block;
}
JavaScript
$("input[name='drinks']").change( function() {
$("fieldset>fieldset").removeClass("active");
var elem = "fieldset." + $(this).attr('id');
$( elem ).addClass( "active" );
});