- expect(20);\r
- equals( $('#text1').attr('value'), "Test", 'Check for value attribute' );\r
- equals( $('#text1').attr('value', "Test2").attr('defaultValue'), "Test", 'Check for defaultValue attribute' );\r
- equals( $('#text1').attr('type'), "text", 'Check for type attribute' );\r
- equals( $('#radio1').attr('type'), "radio", 'Check for type attribute' );\r
- equals( $('#check1').attr('type'), "checkbox", 'Check for type attribute' );\r
- equals( $('#simon1').attr('rel'), "bookmark", 'Check for rel attribute' );\r
- equals( $('#google').attr('title'), "Google!", 'Check for title attribute' );\r
- equals( $('#mark').attr('hreflang'), "en", 'Check for hreflang attribute' );\r
- equals( $('#en').attr('lang'), "en", 'Check for lang attribute' );\r
- equals( $('#simon').attr('class'), "blog link", 'Check for class attribute' );\r
- equals( $('#name').attr('name'), "name", 'Check for name attribute' );\r
- equals( $('#text1').attr('name'), "action", 'Check for name attribute' );\r
- ok( $('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );\r
- equals( $('#text1').attr('maxlength'), '30', 'Check for maxlength attribute' );\r
- equals( $('#text1').attr('maxLength'), '30', 'Check for maxLength attribute' );\r
- equals( $('#area1').attr('maxLength'), '30', 'Check for maxLength attribute' );\r
- equals( $('#select2').attr('selectedIndex'), 3, 'Check for selectedIndex attribute' );\r
- equals( $('#foo').attr('nodeName'), 'DIV', 'Check for nodeName attribute' );\r
- equals( $('#foo').attr('tagName'), 'DIV', 'Check for tagName attribute' );\r
+ expect(26);\r
+ equals( jQuery('#text1').attr('value'), "Test", 'Check for value attribute' );\r
+ equals( jQuery('#text1').attr('value', "Test2").attr('defaultValue'), "Test", 'Check for defaultValue attribute' );\r
+ equals( jQuery('#text1').attr('type'), "text", 'Check for type attribute' );\r
+ equals( jQuery('#radio1').attr('type'), "radio", 'Check for type attribute' );\r
+ equals( jQuery('#check1').attr('type'), "checkbox", 'Check for type attribute' );\r
+ equals( jQuery('#simon1').attr('rel'), "bookmark", 'Check for rel attribute' );\r
+ equals( jQuery('#google').attr('title'), "Google!", 'Check for title attribute' );\r
+ equals( jQuery('#mark').attr('hreflang'), "en", 'Check for hreflang attribute' );\r
+ equals( jQuery('#en').attr('lang'), "en", 'Check for lang attribute' );\r
+ equals( jQuery('#simon').attr('class'), "blog link", 'Check for class attribute' );\r
+ equals( jQuery('#name').attr('name'), "name", 'Check for name attribute' );\r
+ equals( jQuery('#text1').attr('name'), "action", 'Check for name attribute' );\r
+ ok( jQuery('#form').attr('action').indexOf("formaction") >= 0, 'Check for action attribute' );\r
+ equals( jQuery('#text1').attr('maxlength'), '30', 'Check for maxlength attribute' );\r
+ equals( jQuery('#text1').attr('maxLength'), '30', 'Check for maxLength attribute' );\r
+ equals( jQuery('#area1').attr('maxLength'), '30', 'Check for maxLength attribute' );\r
+ equals( jQuery('#select2').attr('selectedIndex'), 3, 'Check for selectedIndex attribute' );\r
+ equals( jQuery('#foo').attr('nodeName'), 'DIV', 'Check for nodeName attribute' );\r
+ equals( jQuery('#foo').attr('tagName'), 'DIV', 'Check for tagName attribute' );\r
+\r
+ jQuery('<a id="tAnchor5"></a>').attr('href', '#5').appendTo('#main'); // using innerHTML in IE causes href attribute to be serialized to the full path\r
+ equals( jQuery('#tAnchor5').attr('href'), "#5", 'Check for non-absolute href (an anchor)' );\r
+\r
+\r
+ // Related to [5574] and [5683]\r
+ var body = document.body, $body = jQuery(body);\r
+\r
+ ok( $body.attr('foo') === undefined, 'Make sure that a non existent attribute returns undefined' );\r
+ ok( $body.attr('nextSibling') === null, 'Make sure a null expando returns null' );\r
+ \r
+ body.setAttribute('foo', 'baz');\r
+ equals( $body.attr('foo'), 'baz', 'Make sure the dom attribute is retrieved when no expando is found' );\r
+ \r
+ body.foo = 'bar';\r
+ equals( $body.attr('foo'), 'bar', 'Make sure the expando is preferred over the dom attribute' );\r
+ \r
+ $body.attr('foo','cool');\r
+ equals( $body.attr('foo'), 'cool', 'Make sure that setting works well when both expando and dom attribute are available' );\r
+ \r
+ body.foo = undefined;\r
+ ok( $body.attr('foo') === undefined, 'Make sure the expando is preferred over the dom attribute, even if undefined' );\r