JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" disabled id="eventprice" name="eventprice" class="form-input" />
<select id="select">
<option data-cost="5">Event 1</option>
<option data-cost="10">Event 2</option>
</select>
JavaScript
$('#select').change(function () {
var str = $(this).find('option:selected').data('cost');
$('#eventprice').val(str);
});
// $('#select').trigger('change');