Bug Tracker

Modify

Ticket #6268 (closed bug: wontfix)

Opened 3 years ago

Last modified 3 years ago

clone() doesn't copy "own properties" of html elements in firefox and safari

Reported by: nikravi Owned by:
Priority: Milestone: 1.4.3
Component: manipulation Version: 1.4.2
Keywords: clone ownProperty Cc:
Blocking: Blocked by:

Description

When cloning an html element, and setting to the "dom" object a property

var div = $("<div />");

div.get(0).aProperty = "aValue";

it is not copied to it's clone.

$("#result").text(div.clone().get(0).aProperty
"undefined");

The bug appears in firefox and safari. In IE6-8 clone() works as expected.

Change History

comment:1 Changed 3 years ago by john

  • Status changed from new to closed
  • Resolution set to wontfix

That's correct - and not something that we guarantee. If you wish to copy values like that in a clone I recommend using jQuery's .data() API (which will copy the data values in the clone).  http://api.jquery.com/data/

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.