Attributes: Trim whitespace from option text when returned as a value

Fixes #14858
Ref #14686
Closes gh-1531
This commit is contained in:
John Hoven
2014-03-06 13:56:09 -06:00
committed by Dave Methvin
parent 5a1db91bf3
commit 9ec429cf62
3 changed files with 17 additions and 1 deletions

View File

@@ -74,7 +74,9 @@ jQuery.extend({
var val = jQuery.find.attr( elem, "value" );
return val != null ?
val :
jQuery.text( elem );
// Support: IE10-11+
// option.text throws exceptions (#14686, #14858)
jQuery.trim( jQuery.text( elem ) );
}
},
select: {