/** * Unwrap Function */ $.fn.unwrap = function() { this.parent(':not(body)') .each(function(){ $(this).replaceWith( this.childNodes ); }); return this; };