How can i get the selected option name or id of a select element using jQuery

Posted by bill on Stack Overflow See other posts from Stack Overflow or by bill
Published on 2010-05-18T20:35:25Z Indexed on 2010/05/18 20:40 UTC
Read the original article Hit count: 161

Filed under:
|
|

Hi All, i have a "questionairre" that is made up of a series of select boxes.

i need to use two properties in the options. For each selected option i need the value (which i know how to get and is working fine) but i also need to store an additional value which represents the id of the specific option in a DB.

One solution would be to put the two values in the "value" property and parse it out.. but if there is some other property i can use that might be easier and clearer.. can i add a custom property?? like databaseId that could be accessed with jQuery?

thanks for ANY suggestions.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about select