views:

82

answers:

1

I need the text from the selected item in a drop down.

Thanks in advance!

+3  A: 

Using the following URL, I came up with this solution:

http://www.mail-archive.com/[email protected]/msg17717.html

$("#myDropdown option:selected").text()

Not sure if this is the best solution, but it seems to work great.

SkippyFire
using the > selector is overkill and would actually break the script if you used `<optgroup>` elements. Just make it `#myDropdown option:selected` intead.
Peter Bailey
Great idea! I always seem to forget about the additional elements you can throw inside the select element!
SkippyFire
Why is this deleted??
Time Machine