JSFiddle - React, Tailwind, and code Playground

HTML

<div id="dropdown">
</div>

JavaScript

$(document).ready(function() {
    BuildDropdown();
});

function BuildDropdown()
{
   var options = ["option1", "option2", "option3"]
   var $select = $("<select></select>");
   
   $.each(options, function(index, value) {
      var $option = $("<option></option>", {
        "text": value,
        "value": value,
		//"id": value
      });
      $select.append($option);
    });
    $select.val("option3");
	$select.find("option:selected").attr('selected', true);
	$('#dropdown').append($select.prop("outerHTML"));
	
    console.log($select.prop("outerHTML"))
}