JSFiddle - React, Tailwind, and code Playground

HTML

<input type="radio" name="radioknof" value="text1" /> <input type='text' id="text1" class="teksti" /><br />
<input type="radio" name="radioknof" value="text2" /> <input type='text' id="text2" class="teksti" />

CSS

.dimmed{
    opacity: 0.5;
}

JavaScript

$('input[name=radioknof]').change(function(e){
     //najprej odksrijemo oba (ali vec) tekstov
     $('.teksti').addClass('dimmed');     
     $('.teksti').attr('disabled', 'disabled')
     //potem zatemnimo tekst, katerega vrednost nosi ta radio
     $('#'+$(this).val()).removeClass('dimmed');
     $('#'+$(this).val()).removeAttr('disabled');
});