Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 17th, 2012  |  syntax: None  |  size: 0.33 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery: Get option innerHTML of first option with value set in HTML select tag
  2. var result = $('#selectId option[value!=""]').first().html();
  3.        
  4. var result = $('#selectId option[value!=""]:first').html();
  5.        
  6. var result = $('#selectId option[value!=""][value]:first').html();
  7.        
  8. $('select[name=thename] option:eq(1)').text();​