function readAll() {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var txtFile = fso.OpenTextFile("kategorije.txt", 1, false, 0);
var fText = txtFile.ReadAll();
txtFile.Close();
fso = null
var array = fText.split("\r\n");
var sel = document.getElementById("dropdown2");
for (var i = 0; i < array.length; i++) {
var opt = document.createElement("option");
opt.innerHTML = array[i];
opt.value = array[i];
sel.appendChild(opt);
}
}
my code works now and it look like this