T
tuxedo
At risk of asking a stupid question, I'd like to return the displayed
text-string of the selectedIndex contained in an options menu, and so I
tried the following one-liner:
document.forms[0].myDinner.options.selectedIndex.text;
But the above returns "undefined" for some reason? Although its not...
While if I do it in 2 steps, I can retrieve the correct string in a
roundabout way:
var where = document.forms[0].myDinner.options.selectedIndex;
alert(document.forms[0].myDinner.options[where].text)
What did I do wrong by the one-liner?
Thanks!
text-string of the selectedIndex contained in an options menu, and so I
tried the following one-liner:
document.forms[0].myDinner.options.selectedIndex.text;
But the above returns "undefined" for some reason? Although its not...
While if I do it in 2 steps, I can retrieve the correct string in a
roundabout way:
var where = document.forms[0].myDinner.options.selectedIndex;
alert(document.forms[0].myDinner.options[where].text)
What did I do wrong by the one-liner?
Thanks!