diff options
Diffstat (limited to 'src/attributes')
-rw-r--r-- | src/attributes/support.js | 2 | ||||
-rw-r--r-- | src/attributes/val.js | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/attributes/support.js b/src/attributes/support.js index 08c2caf08..376b54ad2 100644 --- a/src/attributes/support.js +++ b/src/attributes/support.js @@ -2,7 +2,7 @@ define([ "../var/support" ], function( support ) { -(function () { +(function() { var input = document.createElement( "input" ), select = document.createElement( "select" ), opt = select.appendChild( document.createElement( "option" ) ); diff --git a/src/attributes/val.js b/src/attributes/val.js index 65d772cc2..6fc4a84bb 100644 --- a/src/attributes/val.js +++ b/src/attributes/val.js @@ -49,10 +49,12 @@ jQuery.fn.extend({ // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; + } else if ( typeof val === "number" ) { val += ""; + } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { + val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; }); } |