.val() on empty options returns the text value rather than the value in Blackberry 4.7. Fixes #6932.

This commit is contained in:
John Resig 2010-08-23 14:10:39 -07:00
parent 396dd21273
commit 392174431a

View 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