1 line
1004 B
JSON
1 line
1004 B
JSON
{"name":"odd","type":"selector","title":":odd Selector","deprecated":null,"removed":null,"desc":"Selects odd elements, zero-indexed. See also <ahref=\"/Selectors/even/\">even</a>.","categories":["selectors/basic-filter-selectors","selectors/jquery-selector-extensions","version/1.0"],"entries":[{"return":"","signatures":{"added":"1.0"},"examples":{"desc":"Finds odd table rows, matching the second, fourth and so on (index 1, 3, 5 etc.).","code":"\n$( \"tr:odd\" ).css( \"background-color\", \"#bbbbff\" );\n","css":"\n table {\n background: #f3f7f5;\n }\n","html":"\n<table border=\"1\">\n <tr><td>Row with Index #0</td></tr>\n <tr><td>Row with Index #1</td></tr>\n <tr><td>Row with Index #2</td></tr>\n <tr><td>Row with Index #3</td></tr>\n</table>\n"},"longdesc":"\n <p>In particular, note that the <em>0-based indexing</em> means that, counter-intuitively, <code>:odd</code> selects the second element, fourth element, and so on within the matched set.</p>\n "}],"slug":"odd-selector"} |