Modify ↓
Ticket #6268 (closed bug: wontfix)
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.
| "undefined"); |
The bug appears in firefox and safari. In IE6-8 clone() works as expected.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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/