jQuery has an unwrap()
method which removes the parent node and leaves the matched element in place:
$(".gallery").contents().filter(".thumbnail").unwrap();
// or (faster)
$(".gallery .thumbnail").unwrap();
More Related Contents:
- Auto resizing the SELECT element according to selected OPTION’s width
- Why is my jQuery :not() selector not working in CSS?
- Is $(document).ready necessary?
- Getting jQuery to recognise .change() in IE
- Get name of time zone
- Add comma to numbers every three digits
- Clone isn’t cloning select values
- How do I hide the tooltip on hover from the title tag when using FancyBox 2.0?
- Controlling the value of ‘this’ in a jQuery event
- Show/Hide Multiple Divs with Jquery
- jQuery AJAX calls in for loop [duplicate]
- Can I force jQuery.css(“backgroundColor”) returns on hexadecimal format?
- jQuery CSS – Write into the -tag
- Merging jQuery objects
- How to read userData in jqgrid?
- jQuery Focus fails on firefox
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery [closed]
- Limit Checkbox amount
- Redirecting after AJAX post in Django
- How to change height div on window resize?
- How do I pass a Dictionary as a parameter to an ActionResult method from jQuery/Ajax?
- jquery live event for added dom elements
- Fancybox2 – different content for tooltip and image title, both from title attribute?
- jQuery: Test if checkbox is NOT checked
- Manually set unobtrusive validation error on a textbox
- jQuery: using a variable as a selector [duplicate]
- jQuery detect click on disabled submit button
- jquery validation not waiting for remote validation to return true, considers form valid
- Listen to changes within a DIV and act accordingly
- Load JQuery into a Chrome extension?