Is there a way instead of doing something like this:
for (item in list){
$("#myList").append("<option>" + list[item] + "</option>");
}
To instead do something like:
for (item in list){
var option = new option(list[item]);
$("#myList").add(option);
}
myList being a drop down selection in the html. I know for this example it doesn’t much matter, I’m just thinking if the thing that gets appended (the <option>) becomes more complicated.
Thanks
Use
Optionandselect.add(native functions):