Opened 12 years ago
Closed 12 years ago
#8937 closed bug (invalid)
wrapAll() Doesn't Expose Wrapper
Reported by: | Owned by: | ||
---|---|---|---|
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.
Change History (2)
comment:1 Changed 12 years ago by
Component: | unfiled → manipulation |
---|---|
Owner: | set to [email protected]… |
Priority: | undecided → low |
Status: | new → pending |
Type: | enhancement → bug |
comment:2 Changed 12 years ago by
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.
Note: See
TracTickets for help on using
tickets.
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.