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

2 Comments

Add a Comment

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