X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=74fd6fcb3cdc8f18c095260fca6778caee92ac0a;hb=a27b5d0468acc5dd8cdfcbff9464546b353e3c04;hp=c095f741a8886eeee1b4bf1a755ed3045a980e8e;hpb=69212c501f8875b4650847053cc41eaa470e5848;p=jquery.git diff --git a/src/core.js b/src/core.js index c095f74..74fd6fc 100644 --- a/src/core.js +++ b/src/core.js @@ -362,6 +362,9 @@ jQuery.fn = jQuery.prototype = { if ( this.length ) { var elem = this[0]; + if( jQuery.nodeName( elem, 'option' ) ) + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, @@ -379,7 +382,7 @@ jQuery.fn = jQuery.prototype = { if ( option.selected ) { // Get the specifc value for the option - value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + value = jQuery(option).val(); // We don't need an array for one selects if ( one )