jquery-theonlytutorials

Learn how to get the text of a select option using jQuery

This post teaches you how to get the text of a select option not the value actually!!

Its pretty simple in jQuery, Look at the below syntax:


$('#yourselectboxid :selected').text()

the above one line of code will give you the selected text (mind its not the value!!).

For your convenience i have written a demo snippet below:

 

Copy and paste the above script and test it yourself!

If you are looking for how to get the value of a select box CLICK HERE

About the Author

agurchand

Software Engineer, Blogger etc., Visit my Youtube channel - <a href="http://www.youtube.com/agurchand">Click Here</a>

2 thoughts on “Learn how to get the text of a select option using jQuery

Leave a Reply

Your email address will not be published. Required fields are marked *