JSFiddle - React, Tailwind, and code Playground
HTML
<select id="mySelect"></select>
<select>
<script type='text/javascript'>
insert_dropdown("val2");
</script>
</select>
<select>
<script type='text/javascript'>
insert_dropdown("val3");
</script>
</select>
JavaScript
$(document).ready(function(){
var myOptions = { val1 : 'AAA', val2 : 'BBB', val3 : 'CCC'};
$.each(myOptions, function(val, text) {
$('#mySelect').append(new Option(text,val));
});
});
//function insert_dropdown(key) {
// alert (key);
// }