aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-09-28 08:53:09 -0700
committerJohn Resig <jeresig@gmail.com>2010-09-28 08:53:09 -0700
commit558d96b42aab634e26a66ff337a03ae89be5b33b (patch)
tree529a31b9793a1490534f9c16b7948c1d1cdf3f5d /src
parent879799fe955f01b85b59fd8a0096d415fc48df03 (diff)
downloadjquery-558d96b42aab634e26a66ff337a03ae89be5b33b.tar.gz
jquery-558d96b42aab634e26a66ff337a03ae89be5b33b.zip
Make setting .css(name, undefined) a no-op. Fixes #4388.
Diffstat (limited to 'src')
-rw-r--r--src/css.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/css.js b/src/css.js
index 07ff686d0..61cdc48f9 100644
--- a/src/css.js
+++ b/src/css.js
@@ -20,6 +20,11 @@ var ralpha = /alpha\([^)]*\)/,
};
jQuery.fn.css = function( name, value ) {
+ // Setting 'undefined' is a no-op
+ if ( arguments.length === 2 && value === undefined ) {
+ return this;
+ }
+
return jQuery.access( this, name, value, true, function( elem, name, value ) {
return value !== undefined ?
jQuery.style( elem, name, value ) :