Posted By

jjmu15 on 02/11/12


Tagged

get dropdown option jquery Value drop down selected


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Obstart
BrockSamsom


Get value of selected option in Drop Down


 / Published in: jQuery
 

This snippet gets the value of the selected dropdown

  1. jQuery.fn.selectedLabel = function()
  2. {
  3. return this.find(':selected').html();
  4. }
  5.  
  6.  
  7. Then you can access the text from a selected option within a select:
  8. var text = $('select#month').selectedLabel();

Report this snippet  

You need to login to post a comment.