If you need to populate a select element using JavaScript, you can use the following code:
function updateSelect(valuesArray)
{
var selectElement = document.getElementById("sel1");//or any other id for your select element
selectElement.options.length = 0;
for(var i=0;i<valuesArray.length;i++)
{
selectElement.options[i] = new Option(valuesArray[i], valuesArray[i]);
}
}
Your HTML select element should look like this:
<select id="sel1">
<option value="" selected></option>
</select>
You can load the select options when the page loads by executing something similar to this:
$(function(){
google.script.run
.withSuccessHandler(updateSelect)
.getSelectOptions(); //a Google Apps Script function that returns an array to updateSelect via the success handler
});
This method allows you to store the values in a spreadsheet for easy access. You may want to consider sorting the options alphabetically and passing parameters to determine how to filter the list.