Bad Programmer Bad Programmer - 3 months ago 19
jQuery Question

How to get currently selected value of a multiple select with Jquery

I have a multiple select dropdown box. I need to make an ajax call every time an item is selected, but am having a problem getting the specific value from the select menu. Instead of retrieving the currently selected value, I get an array of all selected values. How can I get the current selected value with JQuery?


OK, just figured it out:


Previously I was using $('#id').val() and that was returning the array. $(this).val() will give you the current selected value.