I perform a AJAX call to retrieve some data to populate a drop-down menu based on a user selection. I get the data fine, but am not able to select the new added/appended options, even though they appear in the console. I am doing this inside the AJAX success parameter -
<div class="row">
<div class="select-field col s12 required">
<label>Manufacturer</label>
<select id="Manufacturer_options" name="Manufacturer_options">
<option value = "" disabled selected> Select Manufacturer</option>
</select>
</div>
</div>
$.ajax({
url: .....
data: ......
dataType: 'json',
success: function(data) {
select = document.getElementById('Manufacturer_options')
var opt = document.createElement('option');
opt.innerHTML = 'test'
select.appendChild(opt)
.
.
.});
Instead of "appendChild", I have also tried "add", "append", as well as building a string and appending that. The option is there when I open the Chrome debugger and inspect the element:
But I cannot open my dropdown, as there are no options outside the hardcoded value disabled option: