// 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
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 ) {