// Check form objects in IE (multiple bugs related)
if ( isFormObjects ) {
- // Returns undefined for empty string, which is the blank nodeValue in IE
+ // Return undefined for empty string, which is the blank nodeValue in IE
ret = elem.getAttributeNode( name ).nodeValue || undefined;
} else {
ret = elem.getAttribute( name );
});
test("attr(String, Object)", function() {
- expect(28);
+ expect(29);
var div = jQuery("div").attr("foo", "bar"),
fail = false;
jQuery("#name").attr('someAttr', '0');
equals( jQuery("#name").attr('someAttr'), '0', 'Set attribute to a string of "0"' );
jQuery("#name").attr('someAttr', 0);
- equals( jQuery("#name").attr('someAttr'), 0, 'Set attribute to the number 0' );
+ equals( jQuery("#name").attr('someAttr'), '0', 'Set attribute to the number 0' );
jQuery("#name").attr('someAttr', 1);
- equals( jQuery("#name").attr('someAttr'), 1, 'Set attribute to the number 1' );
+ equals( jQuery("#name").attr('someAttr'), '1', 'Set attribute to the number 1' );
// using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents();
j.removeAttr("name");
QUnit.reset();
-
+
+ // Type
var type = jQuery("#check2").attr('type');
var thrown = false;
try {
}
ok( thrown, "Exception thrown when trying to change type property" );
equals( "button", button.attr('type'), "Verify that you can't change the type of a button element" );
+
+ // Setting attributes on svg elements (bug #3116)
+ var $svg = jQuery('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="3000" height="3000">'
+ + '<circle cx="200" cy="200" r="150" />'
+ + '</svg>').appendTo('body');
+ equals( $svg.attr('cx', 100).attr('cx'), "100", "Set attribute on svg element" );
+ $svg.remove();
});
test("attr(jquery_method)", function(){