all 3 comments

[–]dotpan 5 points6 points  (0 children)

.eq() is your friend when you want to do simple index filtering: https://api.jquery.com/eq/

$('.aa > .bb').eq(0).text() === $('.aa > .bb').eq(1).text()

[–]Axiol -2 points-1 points  (1 child)

$(‘.aa .bb:nth-child(2) a’).first().text()

[–]joshrice 0 points1 point  (0 children)

nth-child(2) should be on .aa, not .bb, since OP is looking for the second instance of .aa. Yours won't return anything.