Getting the selected option value in jQuery

Posted by misha-moroshko on Stack Overflow See other posts from Stack Overflow or by misha-moroshko
Published on 2010-04-18T15:28:58Z Indexed on 2010/04/18 15:33 UTC
Read the original article Hit count: 158

Filed under:

I would like to print the selected values of all selects using jQuery. I did it like this, but I feel that there is a nicer way to write the same. Am I right ?

$("select").each(function() {
    alert(this.options[this.selectedIndex].value);
});

© Stack Overflow or respective owner

Related posts about jQuery