Setting selected item in dropDownlist component

Ok, I thought this would be easy.


I have a dropdown list component with 3 items in it, values "one", "two", "three". The default selected item is "one". I want to use script to change the selected item to "two". Below is the script that I have tried without success. I am not skilled enough yet with the web console to figure out the problem.


for (i = 0; i < 3; i++) {

if (dropDownList1.items[i].value == "two")

{ dropDownList1.items[i].isSelected == True;}

};


I expect 'isSelected' is not the correct function for this.

isSelected is the correct function, you need to use a single '=' to change the selection.


'is.Selected == true' (comparison) returns a true or false value depending if it is selected or not.

'is.Selected = true' (assignment) changes the selection


Also, 'true' and 'false' do not have initial capitals.


Good luck


Well you learn something new everyday ! Thanks, that did the trick.