var min = 12,
max = 100,
select = document.getElementById('selectElementId');
for (var i = min; i<=max; i++){
var opt = document.createElement('option');
opt.value = i;
opt.innerHTML = i;
select.appendChild(opt);
}
//add one option
let select = document.getElementById('mySelect');
let option = document.createElement('option');
option.value = 1;
option.text = 'option 1';
select.add(option);
//Add few option , exemple from Json 'items'
for (const key in items) {
if (Object.hasOwnProperty.call(items, key)) {
const item = items[key];
let option = document.createElement('option'); // again init option
option.value = item.id;
option.text = item.name;
select.add(option);
}
}
var min = 12,
max = 100,
select = document.getElementById('selectElementId');
for (var i = min; i<=max; i++){
var opt = document.createElement('option');
opt.value = i;
opt.innerHTML = i;
select.appendChild(opt);
}