It's unclear what you want to do.
Do you want the value of the first "selected" option?
And by adding "first", does that mean your drop-down is a multi-select
dropdown (allows for selecting more than one option)?
Please clarify.

If for selected values, you can use:
$("#selectBoxID").val();
(If it's a multi-select dropdown, all the selected values will be in
the form of an array.)

On Oct 21, 10:15 am, slava <mikerin.sl...@gmail.com> wrote:
> Hello,
> I am trying to extract value of a dropdown on select and use it in a
> function.
> Jquery has .each method to loop over matches, but I just need the
> first match. I could use each and break loop after first run, but
> there must be a better way..
>
> $("#venue").change(function(){
>             $("option:selected", this).each(function(){
>             ....
>             return false;
>             });
>
> });
>
> Can I use something like this?
> $("option:selected", this).first(function(){
>
> });
>
>

Reply via email to