Jquery dropdown selected value

 

Today we had a little situation where to get the selected text of Dropdown in Jquery. As far as I know we can get only the value as given below

$("#somedrop").val()

 

This gives the selected value. I did a little google and found a helpful text in discussion forums . The answer will be simple.

 

$("#somedrop option:selected").text()

 

Please let me know if you have some other ways also.

 

Thanks,

Thani

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Print | posted on Friday, December 04, 2009 1:08 AM

Comments on this post

# re: Jquery dropdown selected value

Requesting Gravatar...
it worked. Thanks.
Left by Loft Conversions on Nov 20, 2011 10:14 PM

Your comment:

 (will show your gravatar)