for (i = 0; i < Array_1.length; i++) {
addItem(dropdown, Array_1[i]);
}
This all works fine but I would also like to have an item preselected using javascript based on the value of a variable but I can’t find a way to do it.
Change the name of your dropdown and the value that you have predefined to show.
You could place this as an on Enter action or as an action for some other event.
Hope this helps.
EDIT:
Reading the post again - I see you wanted to do this based on a variable…
Therefore - change as below - replace variable_Name with the name of your associcated variable.