I have a dropdown list as part of a form. It calls a JavaScript function as its action, and its content is one of several strings.
In that function, I need to get the string that the user selected. I came across a function that lets me get the index number of the item selected, but as the contents of the list may vary, it’s effectively useless. Is there a method that lets me get the actual string that the user entered, perhaps with the DOM and getElementById(), or with JQuery?
I considered using a textfield, but that brings up the possibility of errors related to the interface.
Not too sure what you want but from what I understood maybe this is it:
HTML
Javascript