i have a jsp page... i am adding some content to page dynamically depending upon request parameters (an array will be returned by request) based on this i have to create a drop
Yes you can have something like this
function addCombo() {
var textb = document.getElementById("txtCombo");
var combo = document.getElementById("combo");
var option = document.createElement("option");
option.text = "${state}";
option.value = "${state}";
try {
combo.add(option, null); //Standard
}catch(error) {
combo.add(option); // IE only
}
textb.value = "";
}
Note: I haven't tested this code , this is just a demonstration