JSFiddle - React, Tailwind, and code Playground
HTML
<span> hello this is test <span>click here</span></span>
JavaScript
$(document).ready(function(){alert($('span>span').parent('span').clone().find("span").empty().parent().text())});
<span> hello this is test <span>click here</span></span>
$(document).ready(function(){alert($('span>span').parent('span').clone().find("span").empty().parent().text())});