JSFiddle - React, Tailwind, and code Playground

HTML

<select id="state">
    <option value="CA">California</option>
    <option value="SE">Somewhere else</option>
</select>

<input type="text" class="st"/>

JavaScript

$(function() {
    $("#state").change(function() {
        var state = $(this).val();
        if (state  == "CA"){
        $(".st").val(state);
            else (state == "SA")
                {
        $(".st").val(state);
                }
        }
        
    })
});