I have dropdown list on my aspx page. I want to mannually set the selected value which in exist in the dropdown list. this value i am getting in var. i want to set this value as selected value when page get initialize. I want this in javascript. is there any property for dropdown as ddp.SelectedValue=’40’..? here I don’t know the index of 40 in the list.
Share
selectedIndexis a property of HTMLSelectElement so you can do the following:And given an OPTION element, you can get its index using the
indexproperty: