Possible duplicate:
jQuery get selected text from dropdown
<select id="id_deals" name="deals" multiple="multiple"> <option value="1">deal 2</option> <option value="2">deal 1</option> </select>
Using jquery, I can get the value of the selected elements as follows:
var selected = $(e.target).val(); >> 2
But surprisingly, when I try to get the actual selected text (for example, transaction 1), it gives me two entries:
var selected_text = $(e.target).text(); >> "\ndeal 2\ndeal 1\n"
Why is this and how can I get the text of the selected entries?
source share