From: John Resig Date: Mon, 23 Aug 2010 21:10:39 +0000 (-0700) Subject: .val() on empty options returns the text value rather than the value in Blackberry... X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=392174431af1c9abc94ab6bd1c14f9f8f92a2a7d .val() on empty options returns the text value rather than the value in Blackberry 4.7. Fixes #6932. --- diff --git a/src/attributes.js b/src/attributes.js index 1278ff8..d2fc202 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -139,7 +139,10 @@ jQuery.fn.extend({ if ( elem ) { if ( jQuery.nodeName( elem, "option" ) ) { - return (elem.attributes.value || {}).specified ? elem.value : elem.text; + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; } // We need to handle select boxes special