I have text stored in a variable which contains several span tags.
I want to get all the contents inside every span at once.
How can I do that with jQuery or javascript?
<htmlText>
Researchthe university has been given a 5 star rating in the current Research Assessment Exercise. It is one of the UK's leading technological universities, specialising in research to provide solutions critical to industry, commerce and the healthcare, voluntary and public sectors.
<span class="NBResult"></span><span class="NBResult">Data transmission speed</span>
<span>, green fuels,small business marketing needs, European bureaucracy and the treatment </span>
<span class="NBSearchTerm">of</span>
<span> </span><span class="NBSearchTerm">cancer</span>
<span> are all under investigation at the university. </span>
</htmlText>