I am trying to get the value of the selected text from <SELECT> with the follow code
var gnm = document.getElementById("nm");
var sval = ngnm.options[ngnm.selectedIndex].text;
but i am getting an error as follows:
Error: Object expected
The line 129 belongs to alert(sval);. I do not understand why it is displaying an error for alert?
Please let me how to grab the selected text from the dropdown menu.
Thank you for your help in advance.