diff options
author | John Resig <jeresig@gmail.com> | 2010-08-23 14:10:39 -0700 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2010-08-23 14:10:39 -0700 |
commit | 392174431af1c9abc94ab6bd1c14f9f8f92a2a7d (patch) | |
tree | 70079722f11a3d54dbdee0aaf06aed9934070511 /src | |
parent | 396dd2127330a7ed742d1e9092af54b668c46e85 (diff) | |
download | jquery-392174431af1c9abc94ab6bd1c14f9f8f92a2a7d.tar.gz jquery-392174431af1c9abc94ab6bd1c14f9f8f92a2a7d.zip |
.val() on empty options returns the text value rather than the value in Blackberry 4.7. Fixes #6932.
Diffstat (limited to 'src')
-rw-r--r-- | src/attributes.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/attributes.js b/src/attributes.js index 1278ff84b..d2fc202b2 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 |