JSFiddle - React, Tailwind, and code Playground

by Pavan Kumar

HTML

<select name="customer_id">
    <option value="c1">customer1</option>
    <option value="c2">customer2</option>
    <option value="c3">customer3</option>
    <option value="c4">customer4</option>
    <option value="c5">customer5</option>
</select>

<input name = "customer" type="text" value="" id = "customer">

JavaScript

jQuery(function($){
    var $idval = $('#customer');
    $('select[name="customer_id"]').change(function(){
        $idval.val($(this).val())
    }).triggerHandler('change')
})