<a href="#">TEST</a>
I want to remove the anchors and keep the Text i.e TEST
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.
If you want to remove the link and leave the text:
$("a").replaceWith(function(){ return $(this).text() });
Online Demo: http://jsbin.com/aguki/edit
If you're using jQuery 1.4+, CMS provided an even shorter answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With