JSFiddle - React, Tailwind, and code Playground
by hunter
HTML
<div id='parent'>
<a href="#">test</a>
Need this
</div>
JavaScript
var temp = $('#parent').clone();
temp.children().remove();
alert(temp.text());
by hunter
<div id='parent'>
<a href="#">test</a>
Need this
</div>
var temp = $('#parent').clone();
temp.children().remove();
alert(temp.text());