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.

2

1 Answer 1

0

Add id to div and use it in that way:

$('#myid').text()

Not the answer you're looking for? Browse other questions tagged or ask your own question.