JSFiddle - React, Tailwind, and code Playground

HTML

<select id="sel">
    <option>other</option>
    <option>opt1</option>
    <option>opt2</option>
</select>
<input type="text" id="txt">
<input type="text" id="txt2">

JavaScript

$('#sel').on('change', function() {
    $('#txt').val( $(this).val() );
    if ( $(this).val() == "other")
    {    
        $('#txt').removeAttr('disabled').focus().val("");
        $('#txt2').attr('disabled', 'true');
    }
    else
    {
        $('#txt').attr('disabled', 'true');
        $('#txt2').removeAttr('disabled').focus().val("");
    }
});