]> source.dussan.org Git - jquery.git/commitdiff
.val() on empty options returns the text value rather than the value in Blackberry...
authorJohn Resig <jeresig@gmail.com>
Mon, 23 Aug 2010 21:10:39 +0000 (14:10 -0700)
committerJohn Resig <jeresig@gmail.com>
Mon, 23 Aug 2010 21:10:39 +0000 (14:10 -0700)
src/attributes.js

index 1278ff84bfd98b19f2c94dcdd6ef6e247db28906..d2fc202b2fb7b50fd1d33be4bc9163b3bc84e0aa 100644 (file)
@@ -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