I have this HTML code :
<div>
<span>
First text
<span class="dot"></span>
Second text
</span>
<span class="other-span">
</span>
</div>
I need to get only Second text. I tried this JQuery code:
const a = $('div').find('span:nth-child(1)').text();
console.log(a);
The output of the jquery code above is this:
First text Second text
What should be the right thing to do to get only Second text after the span element with class dot