aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.js
diff options
context:
space:
mode:
authorrwldrn <waldron.rick@gmail.com>2011-05-20 11:03:33 -0400
committertimmywil <tim.willison@thisismedium.com>2011-05-20 11:03:33 -0400
commitf82b9dddc498efdfbcd0978f8ba3e1da3b48eff3 (patch)
tree3238e4c108d250c7bd288a5c4f36a80902f78937 /src/attributes.js
parenta1545b5079f4a25fb1dbe7cdfce76fff7a73afe3 (diff)
downloadjquery-f82b9dddc498efdfbcd0978f8ba3e1da3b48eff3.tar.gz
jquery-f82b9dddc498efdfbcd0978f8ba3e1da3b48eff3.zip
Landing pull request 382. Adds support for number values (meter,progress); Fixes #9319.
More Details: - https://github.com/jquery/jquery/pull/382 - http://bugs.jquery.com/ticket/9319
Diffstat (limited to 'src/attributes.js')
-rw-r--r--src/attributes.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/attributes.js b/src/attributes.js
index c239dd7f3..5396a90e5 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -165,7 +165,13 @@ jQuery.fn.extend({
return ret;
}
- return (elem.value || "").replace(rreturn, "");
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
}
return undefined;