I'd like to get rid of all links in a specific div tag with the help of jquery.
E.g from this:
<div id="some_div">
<a href="whatever.html">click here</a>
</div>
To this:
<div id="some_div">
click here
</div>
Thanks in advance.
I'd like to get rid of all links in a specific div tag with the help of jquery.
E.g from this:
<div id="some_div">
<a href="whatever.html">click here</a>
</div>
To this:
<div id="some_div">
click here
</div>
Thanks in advance.
var textToReplace = $("#some_div a").text();
$("#some_div").text(textToReplace);
As of 1.4, you can use $.unwrap()
:
$("#some_div a").contents().unwrap();
Online Demo: http://jsbin.com/otobu/edit