Solved

Get current text of dropdownlist

Posted on 2011-09-29
4
248 Views
Last Modified: 2012-06-21
Please provide jQuery code to get the text of the dropdownlist.

This is not based upon what is selected, just what appears inside the text.  I want to get the text whether or not something has ever been picked from the drop down list items or not.
0
Comment
Question by:knowlton
  • 2
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 36816142
use : $("option:selected").text()

test page : http://jsfiddle.net/jzAzM/
0
 
LVL 5

Author Closing Comment

by:knowlton
ID: 36816249
thx
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36816265
for a specific dropdown : $("option:selected", "#yourdropdownid").text()

http://jsfiddle.net/jzAzM/2/
0
 
LVL 5

Author Comment

by:knowlton
ID: 36816744
Okay...thanks!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now