I have a drop down that has an \'ID, Name\' Pair.
Example
Jon Miller
Jim Smith
Jen Morsin
Jon MIller has ID of 101
Jim Smith has ID of 10
As has been pointed out ... in a select
box, the .val()
attribute will give you the value of the selected option. If the selected option does not have a value attribute it will default to the display value of the option (which is what the examples on the jQuery documentation of .val show.
you want to use .text()
of the selected option:
$('#Crd option:selected').text()