JSFiddle - React, Tailwind, and code Playground
HTML
<label class="radio">
<input type="radio" name="enable" id="button" value="1">Button</label>
<label class="radio">
<input type="radio" name="enable" id="text" value="2" checked>Text</label>
<div id="choice-1">
<label class="control-label">Gender:</label>
<label class="radio">
<input type="radio" name="kommentar_plansaker" id="button1" value="1" disabled=disabled> Man</label>
<label class="radio">
<input type="radio" name="kommentar_plansaker" id="button1" value="2" disabled=disabled> Woman</label>
<br>
<label class="radio">
<input type="text" name="kommentar_plansaker" id="text1" value="1">
</label>
</div>
<div id="output"></div>
JavaScript
$("input[id='text']").change(function () {
$('input[id^=button1]').prop('disabled', true);
$('input[id^=button1]').prop('checked', false);
$('input[id^=text1]').prop('disabled', false);
$('input[id^=text1]').val('');
$('input#kommentar_plansaker-' + this.value).show();
});
$("input[id='button']").change(function () {
$('input[id^=button1]').prop('disabled', false);
$('input[id^=text1]').prop('disabled', true);
$('input[id^=text1]').val('Disabled');
$('input#kommentar_plansaker-' + this.value).show();
});