Skip to content

Commit

Permalink
.val() on empty options returns the text value rather than the value …
Browse files Browse the repository at this point in the history
…in Blackberry 4.7. Fixes #6932.
  • Loading branch information
jeresig committed Aug 23, 2010
1 parent 396dd21 commit 3921744
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/attributes.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ jQuery.fn.extend({


if ( elem ) { if ( elem ) {
if ( jQuery.nodeName( elem, "option" ) ) { 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 // We need to handle select boxes special
Expand Down

0 comments on commit 3921744

Please sign in to comment.