mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Attributes: revert returning null for non-elements
This commit is contained in:
parent
5dc4616ca0
commit
7632b7454b
@ -28,7 +28,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
|
||||
|
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user