aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes/val.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/attributes/val.js')
-rw-r--r--src/attributes/val.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/attributes/val.js b/src/attributes/val.js
index 6d6b8ea7c..42ef32343 100644
--- a/src/attributes/val.js
+++ b/src/attributes/val.js
@@ -71,6 +71,16 @@ jQuery.fn.extend({
jQuery.extend({
valHooks: {
+ option: {
+ get: function( elem ) {
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+ // Support: IE10-11+
+ // option.text throws exceptions (#14686, #14858)
+ jQuery.trim( jQuery.text( elem ) );
+ }
+ },
select: {
get: function( elem ) {
var value, option,