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: | matthew@exanimo.com | Owned by: | matthew@exanimo.com |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | manipulation | Version: | 1.5.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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 />'); $('.some-consecutive-elements').wrapAll(wrapper); 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 comment:1
component: | unfiled → manipulation |
---|---|
owner: | → matthew@exanimo.com |
priority: | undecided → low |
status: | new → pending |
type: | enhancement → bug |
Changed April 22, 2011 01:41PM UTC by comment:2
resolution: | → invalid |
---|---|
status: | pending → closed |
That's the way the API is documented to work. Just like .clone()
selects the clones, not the original elements.
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.