Reputation: 3541
I'm trying to remove the <p>
tag inside the <h3>
without losing the content.
<h3 class="blog-heading">
<p>This is content</p>
</h3>
I tried with unwrap()
, remove()
and empty()
function but these functions are removing my data as well.
$('.blog-heading').find('p').remove();
Can any one guide me is this possible in jquery and how can i fix this. I will appreciate. Thank You.
Upvotes: 1
Views: 98
Reputation: 74420
You want to unwrap p
content:
$('.blog-heading p').contents().unwrap();
Upvotes: 3
Reputation: 1956
try the following
$('.blog-heading').text($('.blog-heading').find('p').text())
Upvotes: 0