-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy patheven-selector.xml
More file actions
23 lines (21 loc) · 1.1 KB
/
even-selector.xml
File metadata and controls
23 lines (21 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<entry type='selector' name="even" return="" >
<sample>:even</sample>
<signature><added>1.0</added> </signature>
<desc>Selects even elements, zero-indexed. See also <a href="/Selectors/odd">odd</a>.</desc>
<longdesc><p>In particular, note that the <em>0-based indexing</em> means that, counter-intuitively, <code>:even</code> selects the first element, third element, and so on within the matched set.</p></longdesc>
<example>
<desc>Finds even table rows, matching the first, third and so on (index 0, 2, 4 etc.).</desc>
<code><![CDATA[$("tr:even").css("background-color", "#bbbbff");]]></code>
<css><![CDATA[
table {
background:#eeeeee;
}
]]></css>
<html><![CDATA[<table border="1">
<tr><td>Row with Index #0</td></tr>
<tr><td>Row with Index #1</td></tr>
<tr><td>Row with Index #2</td></tr>
<tr><td>Row with Index #3</td></tr>
</table>]]></html>
</example>
</entry>