複数のスパンタグを含む変数にテキストを格納しています。
すべてのコンテンツをすべてのスパンの中にまとめて取得したいと考えています。 jQueryやjavascriptを使ってどうすればいいですか?子供と一緒にjQueryを使ってテキストを取得する方法
<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>
私はこれらのテキストをvriableに入れています....どうすれば選択できますか? – Andromeda
セレクタ内に変数を配置します。私はコードを更新します... – Sampson
しかし、スパンの外にもいくつかのコンテンツがあります。私は範囲内のものだけを選択したいと考えています... – Andromeda