Click Upvote Click Upvote - 1 year ago 62
Javascript Question

How to get all options of a select using jQuery?

How can I get all the options of a select through jQuery by passing on its ID?

I am only looking to get their values, not the text.

ybo ybo
Answer Source


$("#id option").each(function()
    // Add $(this).val() to your list
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download