Permalink
Browse files

Attributes: revert returning null for non-elements

  • Loading branch information...
timmywil committed Mar 16, 2015
1 parent 0b07c65 commit a40365549195e4afdf4743f403c12599a3dd4a77
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/attributes/attr.js
  2. +1 −1 test/unit/attributes.js
View
@@ -31,7 +31,7 @@ jQuery.extend({
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return null;
return;
}
// Fallback to prop when attributes are not supported
View
@@ -371,7 +371,7 @@ test( "attr(String, Object)", function() {
jQuery.each( [ commentNode, textNode, attributeNode ], function( i, elem ) {
var $elem = jQuery( elem );
$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 ) {

0 comments on commit a403655

Please sign in to comment.