1var courses = document.getElementById("special_selection");
2
3 // clear select
4 var length = courses.options.length;
5 for (i = length - 1; i >= 0; i--) {
6 courses.options[i] = null;
7 }
8 for (var i = 0; i < data.length; i++) {
9 var option = document.createElement("OPTION"),
10 txt = document.createTextNode(data[i].coursetitle);
11 option.appendChild(txt);
12 option.setAttribute("value", data[i].KF);
13 courses.insertBefore(option, courses.lastChild);
14
15 }