问问题
2031 次
1 回答
0
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("test.txt", 1, true);
select = document.getElementById('dropdown2');
var arr=new Array();
var i=0;
do {
arr[i]=s.readLine();
}
while(s.readLine!=null);
for (i = 0; i<arr.length; i++){
var opt = document.createElement('option');
opt.value = "option"+(i+1);
opt.innerHTML = arr[i];
select.appendChild(opt);
}
于 2013-07-22T11:58:20.287 回答