Skip to main content

Bug Tracker

Side navigation

#8937 closed bug (invalid)

Opened April 21, 2011 04:41PM UTC

Closed April 22, 2011 01:41PM UTC

wrapAll() Doesn't Expose Wrapper

Reported by: Owned by:
Priority: low Milestone:
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.
Attachments (0)
Change History (2)

Changed April 21, 2011 04:44PM UTC by timmywil comment:1

component: unfiledmanipulation
owner: →
priority: undecidedlow
status: newpending
type: enhancementbug

Thanks for taking the time to contribute to the jQuery project! Please provide a reduced test case on that reproduces the issue experienced to help us assess your ticket.

Additionally, test against the jQuery (edge) version to ensure the issue still exists.

Changed April 22, 2011 01:41PM UTC by dmethvin comment:2

resolution: → invalid
status: pendingclosed

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