File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1060,7 +1060,7 @@ jQuery.extend({
1060
1060
elem . parentNode . selectedIndex ;
1061
1061
1062
1062
// If applicable, access the attribute via the DOM 0 way
1063
- if ( notxml && ! special && name in elem ) {
1063
+ if ( name in elem && notxml && ! special ) {
1064
1064
if ( set ) {
1065
1065
// We can't allow the type property to be changed (since it causes problems in IE)
1066
1066
if ( name == "type" && jQuery . nodeName ( elem , "input" ) && elem . parentNode )
@@ -1083,11 +1083,13 @@ jQuery.extend({
1083
1083
// convert the value to a string (all browsers do this but IE) see #1070
1084
1084
elem . setAttribute ( name , "" + value ) ;
1085
1085
1086
- if ( msie && special && notxml )
1087
- return elem . getAttribute ( name , 2 ) ;
1088
-
1089
- return elem . getAttribute ( name ) ;
1086
+ var attr = msie && notxml && special
1087
+ // Some attributes require a special call on IE
1088
+ ? elem . getAttribute ( name , 2 )
1089
+ : elem . getAttribute ( name ) ;
1090
1090
1091
+ // Non-existent attributes return null, we normalize to undefined
1092
+ return attr === null ? undefined : attr ;
1091
1093
}
1092
1094
1093
1095
// elem is actually elem.style ... set the style
You can’t perform that action at this time.
0 commit comments