[jQuery] Re: strip tag leaving its content

2009-01-24 Thread Ricardo Tomasi
If you want to preserve other elements in the same parent, just change html() to append/prepend: $(this).parent().append( $(this).remove().html() ); On Jan 24, 11:33 am, BrainBurner wrote: > Thanks Stephan, your solutions works very well! > I also thought, that rewrtiting the whole html of the

[jQuery] Re: strip tag leaving its content

2009-01-24 Thread BrainBurner
Thanks Stephan, your solutions works very well! I also thought, that rewrtiting the whole html of the container could overwrite other elements, but it is also a very original idea! Thank you both! On Jan 24, 2:22 pm, Stephan Veigl wrote: > This solution is easier one if the parent element has o

[jQuery] Re: strip tag leaving its content

2009-01-24 Thread Stephan Veigl
This solution is easier one if the parent element has only one element - the span, if the parent element hase more spans (or other elements) parent.html() would overwrite all elements and replace them with the content of the child. The performace might also be an issue, however I have no idea whi

[jQuery] Re: strip tag leaving its content

2009-01-24 Thread Mike Alsup
> I'm writing an effect, which has to build a span around my element, > but when my effect is finished I wanted to strip this span tag, in > order to leave the situation as it was before.. > > How can I strip a tag?? > Is there something like: $(this).parent().strip(); ??? In your example is 'thi

[jQuery] Re: strip tag leaving its content

2009-01-24 Thread Stephan Veigl
try: var wrap = $("#wrap"); // your span or other wrapper element wrap.children().insertBefore(wrap); // insert children before wrapper element, insertAfter() inverses children order wrap.remove(); // remove wrapper element by(e) Stephan 2009/1/24 BrainBurner : > > Hello, > > I'm writing an ef