Title: Retrieving Select value using JQuery
Last modified: December 8, 2022

---

# Retrieving Select value using JQuery

 *  [ranierbonnici](https://wordpress.org/support/users/ranierbonnici/)
 * (@ranierbonnici)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/retrieving-select-value-using-jquery/)
 * I have a form with some dropdowns (select elements). I need to do some client-
   side validation on the selected values using JQuery. However, I noted that the
   value and text attributes of the select are not changing when the user makes 
   a choice. jQuery(#idOfElement).val() and text() return undefined. I also tried
   to identify the selected option element to no avail.
 * Is there a way to retrieve the dropdown value?
    -  This topic was modified 3 years, 5 months ago by [ranierbonnici](https://wordpress.org/support/users/ranierbonnici/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fretrieving-select-value-using-jquery%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [fastfasterfastest](https://wordpress.org/support/users/fastfasterfastest/)
 * (@fastfasterfastest)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/retrieving-select-value-using-jquery/#post-16273580)
 * There are no `select` elements on that page with an `id` attribute. Either add`
   id` attributes to the `select` elements and use the code you have tried, or use
   another suitable selector, e.g. [Attribute Equals Selector](https://api.jquery.com/attribute-equals-selector/)
   to find the desired `select` element (and if you are using the `name` attribute
   then make sure the `name` is unique in the document.)
 *  Thread Starter [ranierbonnici](https://wordpress.org/support/users/ranierbonnici/)
 * (@ranierbonnici)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/retrieving-select-value-using-jquery/#post-16274270)
 * Of course I’m using an alternative selector. I just gave that simplified example
   to explain myself. The issue is retrieving the drop-down value once I have a 
   reference, not getting the reference.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Retrieving Select value using JQuery’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [option](https://wordpress.org/support/topic-tag/option/)
 * [select](https://wordpress.org/support/topic-tag/select/)
 * [value](https://wordpress.org/support/topic-tag/value/)

 * 2 replies
 * 2 participants
 * Last reply from: [ranierbonnici](https://wordpress.org/support/users/ranierbonnici/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/retrieving-select-value-using-jquery/#post-16274270)
 * Status: not resolved