Bug Tracker

Opened 9 years ago

Closed 8 years ago

Last modified 6 years ago

#5524 closed bug (duplicate)

clone() doesn't clone the textarea's text value

Reported by: bluedevil2k Owned by:
Priority: minor Milestone: 1.4
Component: core Version: 1.3.2
Keywords: clone textarea Cc:
Blocked by: Blocking:

Description

When calling clone() on an entire DIV that contains multiple textarea elements, the cloned textarea's returns blank on a call to .val(), while the original still returns the correct text on .val().

Here's some sample code to reproduce the problem (assume there are multiple DIV's on the page, each with multiple textareas with text in them).

jQuery("div").each(function(){

var clone = jQuery(this).clone(); console.log(jQuery(this).find("textarea").eq(0).val()); will output correct text

console.log(clone.find("textarea").eq(0).val()); will output blank

});

This was seen in Firefox 3.5 and IE8.

Change History (6)

comment:1 Changed 9 years ago by dmethvin

Closed dup #5641 with further discussion.

comment:2 Changed 9 years ago by szrudi

will this be fixed? as I see it's a bug for more than 2 years now.. (same as #3016)

comment:3 Changed 8 years ago by addyosmani

Resolution: duplicate
Status: newclosed

Closing as a duplicate of #3016.

comment:4 Changed 8 years ago by addyosmani

Duplicate of #3016.

comment:5 Changed 6 years ago by anonymous

3 years and no patch? anyone interested in resolving this? I have no idea how to propose patched code to the jQuery team

comment:6 in reply to:  5 Changed 6 years ago by scottgonzalez

Replying to anonymous:

3 years and no patch? anyone interested in resolving this?

You should read the discussions in the duplicates. Specifically, read http://bugs.jquery.com/ticket/3016#comment:17

I have no idea how to propose patched code to the jQuery team

Send a pull request on GitHub: http://contribute.jquery.org/code/

Note: See TracTickets for help on using tickets.