The eq method
The eq method selects the n-th element among those found, i.e. the element with a certain number, for example, the third or fifth. The first element found will have the number 0. The number of an element in a set can be either positive or negative. In the second case, the count is from the end, -1 will be the last element, -2 - the penultimate one, and so on.
Syntax
$(selector).eq(number);
Example
Let's find all the paragraphs, and then color the third one (numbered 2, since the numbering starts from zero) red:
<p>text</p>
<p>text</p>
<p>text</p>
<p>text</p>
$('p').eq(2).css('color', 'red');
HTML the code will look like this:
<div class="result">
<p>text</p>
<p>text</p>
<p style="color: red;">text</p>
<p>text</p>
</div>