Side navigation
#10057 closed feature (wontfix)
Opened August 15, 2011 12:07PM UTC
Closed August 15, 2011 01:41PM UTC
Last modified August 15, 2011 08:22PM UTC
Consistency: no unwrapInner() available.
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | manipulation | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi,
it is nice that we have a wrapInner() function for wrapping the contents of an element - unfortunately, there is no function which does the opposite: unwrapInner(). As there is a unwrap() function nothing should be wrong adding a the missing unwrapInner() to jQuery.
I'm working on a project which heavily requires wrapping and unwrapping, a solution would be very appreciated!
Attachments (0)
Change History (3)
Changed August 15, 2011 01:41PM UTC by comment:1
component: | unfiled → manipulation |
---|---|
priority: | undecided → low |
resolution: | → wontfix |
status: | new → closed |
Changed August 15, 2011 01:57PM UTC by comment:2
+1
Changed August 15, 2011 08:22PM UTC by comment:3
Since you can wrap several levels of stuff around the elements in a .wrap*
method I am not sure how we could know what the "wrapper" consisted of anyway. Assuming it is a single parent element is wrong:
This structure may be nested several levels deep, but should contain only one innermost element. The structure will be wrapped around the content of each of the elements in the set of matched elements. -- http://api.jquery.com/wrapInner/
The code best able to determine this is the application, not jQuery.
I think it's simple enough to do a .contents().unwrap(). I'll close as wontfix, but if any of the team feels differently, please reopen.
http://jsfiddle.net/timmywil/67skY/