How can you get the selected value from drop down list using JavaScript? I have tried the following but it does not work.
var sel = document.getElementById(\
Direct value should work just fine:
value
var sv = sel.value; alert(sv);
The only reason your code might fail is when there is no item selected, then the selectedIndex returns -1 and the code breaks.
selectedIndex