<div>div-1
<span>div-1-span-1
<div>div-1-span-1-div</div>
<span>div-1-span-1-span</span>
</span>
</div>
I am trying to search this DOM. My search criteria is innerText, which is "div-1". If that innerText is found, then I want to return the value as "div-1-span-1-div" and "div-1-span-1-span" which are again the innerText. How to achieve this using Javascript.