aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.js
diff options
context:
space:
mode:
authorOleg <markelog@gmail.com>2012-10-02 03:36:54 +0400
committerDave Methvin <dave.methvin@gmail.com>2012-12-13 09:29:40 -0500
commit13651f296d14b2400d703d1945065c0373862eb5 (patch)
tree7d4fac71aee5f325d4d31f8c2424022b705614bd /src/attributes.js
parent0018f7700bf8004d573c752ecbf66f299769c4de (diff)
downloadjquery-13651f296d14b2400d703d1945065c0373862eb5.tar.gz
jquery-13651f296d14b2400d703d1945065c0373862eb5.zip
Fix #9646. Cloned nodes shouldn't affect original in IE7. Close gh-947.
Diffstat (limited to 'src/attributes.js')
-rw-r--r--src/attributes.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/attributes.js b/src/attributes.js
index ffeab3c69..688282e09 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -522,7 +522,15 @@ if ( !getSetAttribute ) {
ret = elem.ownerDocument.createAttribute( name );
elem.setAttributeNode( ret );
}
- return ( ret.value = value + "" );
+
+ ret.value = value += "";
+
+ // Break association with cloned elements (#9646)
+ if ( name !== "value" && value !== elem.getAttribute( name ) ) {
+ elem.setAttribute( name, value );
+ }
+
+ return value;
}
};