0

lets say theres 4 divs

<div class="list">
  <div class="hello">hello</div>
  <div class="hello">how</div>
  <div class="hello">are</div>
  <div class="hello">you</div>
</div>

how can i select the third one and display the text with jquery?

$('.hello')[2].text()

trying to use something like that.

Mangu Singh Rajpurohit
  • 10,806
  • 4
  • 68
  • 97
Glutch
  • 662
  • 1
  • 6
  • 19

1 Answers1

0

Add id to div and use it in that way:

$('#myid').text()