Replace a link with it's text with jQuery

Viewed 6178
<a href="#">TEST</a>

I want to remove the anchors and keep the Text i.e TEST

2 Answers

You could also use the new $.unwrap method (jQuery 1.4+) applied to the contents of the anchor:

​$('a').contents().unwrap();​​

Check an example here.

Related