Bug Tracker

Opened 7 years ago

Closed 6 years ago

#5996 closed enhancement (wontfix)

Add attribute map support for .clone()

Reported by: Licensed to Gil Owned by:
Priority: minor Milestone:
Component: core Version: 1.4.1
Keywords: needsreview Cc:
Blocked by: Blocking:


Most of the time when I use the .clone() function, I'm cloning an element with an ID, so I have to change the ID with .attr() straight away.

I'd love to see the new $("<div/>", {attrMap}) syntax applied to .clone() as well, so that I could do:

$("#id").clone({id: "newID"});

Patch with unit tests here:




Change History (2)

comment:1 Changed 6 years ago by dmethvin

  • Keywords needsreview added; clone manipulation removed
  • Status changed from new to open

Feature creep...marking for review. To me the explicit .clone().attr() is better.

comment:2 Changed 6 years ago by john

  • Milestone 1.4.2 deleted
  • Resolution set to wontfix
  • Status changed from open to closed

Agreed, explicit .clone().attr() is likely fine in this case.

Note: See TracTickets for help on using tickets.