DropDown List SelectedIndex is not working with getElementById in javascript
问题 I have a DropDown list named as batches. If I selected 2nd option,dropdown.selectedIndex inside the OnChange function always shows the selected index. But document.getElementById("batches").selectedIndex always shows the 1st index. Why is this? Actually I want read the correct selectedIndex of batches in another function that's why I need a way to get the correct selected index in both ways. function OnChange(dropdown){ var myindex = dropdown.selectedIndex;// This prints correctly alert(