I need to bind a java.util.List<String>
to a HTML drop-down javascript.
I am able to get the java.util.List
in the below format:
[Name1,Name2,Name3]
For binding I will use this code (it works fine):
var opt = document.createElement("OPTION");
opt.text = xhr.responseText;
opt.value = xhr.responseText;
document.getElementById("slctFullName").options.add(opt);
But I don't know the easiest approach to iterate through these elements.
Please let me know how to iterate through the elements :(
Thanks,