Ensure that buildFragment clones elements properly in all browsers. Fixes #3879, #6655. Also improves form element clone tests and fixes bugs in $.fn.clone exposed by these new test cases related to the values of checkboxes and radio buttons in IE.
This commit is contained in:
parent
012f0c3b4b
commit
b14f02899e
4 changed files with 48 additions and 15 deletions
|
@ -129,7 +129,7 @@ jQuery.fn = jQuery.prototype = {
|
|||
|
||||
} else {
|
||||
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
|
||||
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
|
||||
selector = (ret.cacheable ? jQuery(ret.fragment).clone()[0] : ret.fragment).childNodes;
|
||||
}
|
||||
|
||||
return jQuery.merge( this, selector );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue