Say I have a few
<p> Hello </p> <p> Hello </p> <p> Hello </p> <p> Hello </p>
I want to replace one "Hello" with "Good bye".
So => $('p')[2].html('Good Bye');
Doesn't work why? Why should I use eq: selector?
It works when I do it.
$('p:eq(3)').html('Good bye')
source share