JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<form>
<select id="mySelect">
<!-- no options provided -->
</select>
</form>
<div id="myDiv"></div>
</body>
JavaScript
$("#mySelect").html('<option value="1">first option</option><option value="2">second option</option>');
$("#myDiv").html("The select element value is: "+$("#mySelect").val()+". However, if you examine the html of the select element, none of the options has the selected attribute.");