Skip to content

Commit f2dc385

Browse files
committed
:eq() selector: Fix content related to selector. Fixes #376
1 parent 245e460 commit f2dc385

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entries/eq-selector.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<desc>Select the element at index <code>n</code> within the matched set.</desc>
1919
<longdesc>
2020
<p>The index-related selectors (<code>:eq()</code>, <code>:lt()</code>, <code>:gt()</code>, <code>:even</code>, <code>:odd</code>) filter the set of elements that have matched the expressions that precede them. They narrow the set down based on the order of the elements within this matched set. For example, if elements are first selected with a class selector (<code>.myclass</code>) and four elements are returned, these elements are given indices <code>0</code> through <code>3</code> for the purposes of these selectors.</p>
21-
<p>Note that since JavaScript arrays use <em>0-based indexing</em>, these selectors reflect that fact. This is why <code>$( ".myclass:eq(2)" )</code> selects the second element in the document with the class myclass, rather than the first. In contrast, <code>:nth-child(n)</code> uses <em>1-based indexing</em> to conform to the CSS specification.</p>
21+
<p>Note that since JavaScript arrays use <em>0-based indexing</em>, these selectors reflect that fact. This is why <code>$( ".myclass:eq(2)" )</code> selects the third element in the document with the class myclass, rather than the second. In contrast, <code>:nth-child(n)</code> uses <em>1-based indexing</em> to conform to the CSS specification.</p>
2222
<p>Prior to jQuery 1.8, the <code>:eq(index)</code> selector did <em>not</em> accept a negative value for <code>index</code> (though the <a href="/eq/"><code>.eq(index)</code></a> method did).</p>
2323
</longdesc>
2424
<note id="jquery-selector-extension-alt" type="additional" data-selector=":eq()" data-alt="$(&quot;your-pure-css-selector&quot;).eq(index)"/>

0 commit comments

Comments
 (0)