Solved

Get current text of dropdownlist

Posted on 2011-09-29
4
255 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Tom 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:Tom Knowlton
ID: 36816744
Okay...thanks!
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

733 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