JSFiddle - React, Tailwind, and code Playground

by gedave

HTML

<form id="myForm">
  <select id="problemCode">
    <option>Problem Code</option>
  </select>
</form>

JavaScript

var pcArray = new Array(
		"Administrative",
		"Artifacts",
		"Burst Disk",
		"Calibration-Align",
		"Checkout And Test",
		"Coil Id");


// Get dropdown element from DOM
var dropdown = document.getElementById("problemCode");

// Loop through the array
for (var i = 0; i < pcArray.length; ++i) {
    // Append the element to the end of Array list
    dropdown[dropdown.length] = new Option(pcArray[i], pcArray[i]);
}