I want to remove all the text and just get the html structure of a node as a string.
This is my node,
<div class='myparent'>
<div>
<div class="pdp-product-price test" id="lll">
<span> 650 rupees</span>
<div class="origin-block">
<span> 1,500 rupees</span>
<span>-57%</span>
</div>
</div>
</div>
</div>
And what I want is something like this,
<div class='myparent'>
<div>
<div class="pdp-product-price test" id="lll">
<span></span>
<div class="origin-block">
<span></span>
<span></span>
</div>
</div>
</div>
</div>
I tried,
$('.myparent').children().empty();
and
$('.myparent').children().text('');
But unfortunately they removed all children.