Q:

jQuery: Disable all links within a div - replace with inner content

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 

A:

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

A:

Hmm - mine is similar to the other quicker-typists' answers, but I would have thought html() would have been what you wanted to use:
$('div a').each(function() {
    $(this).replaceWith($(this).html());
});

