Commit a4036554 authored by Timmy Willison's avatar Timmy Willison

Attributes: revert returning null for non-elements

parent 0b07c652
...@@ -31,7 +31,7 @@ jQuery.extend({ ...@@ -31,7 +31,7 @@ jQuery.extend({
// don't get/set attributes on text, comment and attribute nodes // don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return null; return;
} }
// Fallback to prop when attributes are not supported // Fallback to prop when attributes are not supported
......
...@@ -371,7 +371,7 @@ test( "attr(String, Object)", function() { ...@@ -371,7 +371,7 @@ test( "attr(String, Object)", function() {
jQuery.each( [ commentNode, textNode, attributeNode ], function( i, elem ) { jQuery.each( [ commentNode, textNode, attributeNode ], function( i, elem ) {
var $elem = jQuery( elem ); var $elem = jQuery( elem );
$elem.attr( "nonexisting", "foo" ); $elem.attr( "nonexisting", "foo" );
strictEqual( $elem.attr("nonexisting"), null, "attr(name, value) works correctly on comment and text nodes (bug #7500)." ); strictEqual( $elem.attr("nonexisting"), undefined, "attr(name, value) works correctly on comment and text nodes (bug #7500)." );
}); });
jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) { jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment