JSFiddle - React, Tailwind, and code Playground

by Nikhil krishnan

HTML

<select name="" id="selectPhoto"></select>

JavaScript

var employees = ["one", "two", "three", "four", "five"];
for (var i = 0; i < employees.length; i++) {
  //creates option tag
  employees.sort();
  jQuery('<option/>', {
    value: employees[i],
    html: employees[i]
  }).appendTo('#selectPhoto');

  var selectedValue = 'three';
  $("#selectPhoto option").filter(function() {
    return $(this).text() == selectedValue;
  }).prop('selected', true);
}