JSFiddle - React, Tailwind, and code Playground
HTML
<select id='names' class='combobox'>
<option value="">Please select name...</option>
</select>
<select id='address' class='combobox' style="display: none">
<option value="">Waiting...</option>
</select>
JavaScript
$(document).ready(function () {
var list = [{
value: 'Address 1',
html: 'Name 1'
}, {
value: 'Address 2',
html: 'Name 2'
},{
value: 'Address 55',
html: 'Name 55'
}];
for (i = 0; i < list.length; i++) { // assume list[i] contains different names
var name_options = $('<option value="' + list[i].value + '">' + list[i].html + '</option>');
$('#names').append(name_options);
} // end of for loop
$('#names').change(function (e) {
var theVal = $(this).val();
$('#address').show().find('option').attr('value', theVal).html(theVal);
$('#address').val(theVal);
});
});