I want to disable all links within a div and replace it with the content that was there.
i.e.
<div><a href="/blah.html">My super link</a></div>
to
<div>My super link</div>
Thanks
You can do it using .replacewith() and a function, like this:
$("div a").replaceWith(function() { return $(this).text(); });
You can see a quick demo here
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