JSFiddle - React, Tailwind, and code Playground

HTML

<form>
<input id="r1" type="radio" name="sex" value="male" /> Male<br />
<input id="r2" type="radio" name="sex" value="female" /> Female<br />
<input type="text" id="txt" />    
</form>

JavaScript

function checkDisabled(evt) {
    var val = $("input[name=sex]:checked").val();
    if (val == 'male') {
        $('#txt').attr('disabled', true);
    } else {
        $('#txt').removeAttr('disabled');
    }
}

$('input[name=sex]:radio').change(checkDisabled);

checkDisabled();