This commit is contained in:
Jörn Zaefferer 2007-01-31 21:36:48 +00:00
parent 4e256bffa3
commit a82b048db8
2 changed files with 4 additions and 2 deletions

View file

@ -102,7 +102,7 @@ test("attr(Hash)", function() {
});
test("attr(String, Object)", function() {
expect(6);
expect(7);
var div = $("div");
div.attr("foo", "bar");
var pass = true;
@ -111,6 +111,8 @@ test("attr(String, Object)", function() {
}
ok( pass, "Set Attribute" );
ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );
$("#name").attr('name', 'something');
ok( $("#name").attr('name') == 'something', 'Set name attribute' );
$("#check2").attr('checked', true);

View file

@ -1281,7 +1281,7 @@ jQuery.extend({
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
// Handle passing in a number to a CSS property
if ( value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
if ( value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
return value + "px";
return value;