My select list is called dropListBuilding
. The folliowng code seems to not work:
for (var i = 0; i < buildings.length; i++) {
var val = buildings[i];
var text = buildings[i];
alert("value of builing at: " + i.toString() + " is: " + val);
$("#dropListBuilding").addOption(val, text, false);
}
This line dies: $("#dropListBuilding").addOption(val, text, false);
What is the right to add items to the drop down in jquey. I have tested without that line and the buildings variable does have my data element.