<pclass="arguement"><strong>-index</strong>An integer indicating the position of the element, counting backwards from the last element in the set. </p>
</li>
</ul>
<divclass="longdesc">
<p>Given a jQuery object that represents a set of DOM elements, the <code>.eq()</code> method constructs a new jQuery object from one of the matching elements. The supplied index identifies the position of this element in the set.</p>
<p>Consider a page with a simple list on it:</p>
<pre>
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 4</li>
<li>list item 5</li>
</ul>
</pre>
<p>We can apply this method to the set of list items:</p>
<pre>
$('li').eq(2).css('background-color', 'red');
</pre>
<p>The result of this call is a red background for item 3. Note that the supplied index is zero-based, and refers to the position of the element within the jQuery object, not within the DOM tree.</p>
<p>If a negative number is provided, this indicates a position starting from the end of the set, rather than the beginning. For example:</p>
<pre>
$('li').eq(-2).css('background-color', 'red');
</pre>
<p>This time list item 4 is turned red, since it is two from the end of the set.</p>