我希望从第二个div中获取与chererio具有相同类(.hello)的文本的html:
<div class="hello">blablabla</div>
<div class="hello">
<h2 id="coucou">Coucou</h2>
blablabla 2 html to <br>
select this is the text I want<br>
blabla bla bla bal balbal blabla
</div>
我想要的结果:
blablabla 2 html to <br>
select this is the text I want<br>
blabla bla bla bal balbal blabla
答案 0 :(得分:0)
看起来像你想要的
$('.hello + .hello').text()
在CSS中,+
表示下一个兄弟姐妹。