Skip to content

Commit a403655

Browse files
committed
Attributes: revert returning null for non-elements
1 parent 0b07c65 commit a403655

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/attributes/attr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jQuery.extend({
3131

3232
// don't get/set attributes on text, comment and attribute nodes
3333
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
34-
return null;
34+
return;
3535
}
3636

3737
// Fallback to prop when attributes are not supported

test/unit/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ test( "attr(String, Object)", function() {
371371
jQuery.each( [ commentNode, textNode, attributeNode ], function( i, elem ) {
372372
var $elem = jQuery( elem );
373373
$elem.attr( "nonexisting", "foo" );
374-
strictEqual( $elem.attr("nonexisting"), null, "attr(name, value) works correctly on comment and text nodes (bug #7500)." );
374+
strictEqual( $elem.attr("nonexisting"), undefined, "attr(name, value) works correctly on comment and text nodes (bug #7500)." );
375375
});
376376

377377
jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) {

0 commit comments

Comments
 (0)