Bug Tracker

Opened 12 years ago

Closed 12 years ago

#8937 closed bug (invalid)

wrapAll() Doesn't Expose Wrapper

Reported by: [email protected] Owned by: [email protected]
Priority: low Milestone: 1.next
Component: manipulation Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:


After using wrapAll() to create a wrapper, there's no way to get a reference to that wrapper (without reselecting, e.g. with an id).

var wrapper = $('<div />');
wrapper.append('<span>Some new text</span>'); // Will not work because the "wrapper" variable is not actually a reference to the wrapping element. You must perform a new selection to get the wrapping element.

Change History (2)

comment:1 Changed 12 years ago by timmywil

Component: unfiledmanipulation
Owner: set to [email protected]
Priority: undecidedlow
Status: newpending
Type: enhancementbug

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on http://jsFiddle.net that reproduces the issue experienced to help us assess your ticket. Additionally, test against the jQuery (edge) version to ensure the issue still exists.

comment:2 Changed 12 years ago by dmethvin

Resolution: invalid
Status: pendingclosed

That's the way the API is documented to work. Just like .clone() selects the clones, not the original elements.

Note: See TracTickets for help on using tickets.