Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Enhancement: selector for Unwrap #1744
Originally reported by nlte@… at: http://bugs.jquery.com/ticket/13967
Unwrap simple removes the parent of selected elements, and accepts no arguments. In some cases it may be desirable to unwrap only if a condition on the parent is met. Enabling to pass a selector to Unwrap would allow this: if the parent matches the selector, then proceed, otherwise do nothing.
Issue reported for jQuery 1.10.0
Comment author: dmethvin
I'm not a fan of the wrappish methods at all, but one reason is exactly this, .unwrap() blindly unwraps elements when the most common case would be that you want to remove a specific wrapper. So this seems like a decent idea if it can be done cheaply. Thoughts?