jQuery:Selector :odd

Overview

Matches all elements with odd-numbered values, counting from zero.

Demo

Description:

Find the 2,4,6 rows of the table (ie, the index values 1,3,5 …).

HTML code:
<table>
  <tr><td>Header 1</td></tr>
  <tr><td>Value 1</td></tr>
  <tr><td>Value 2</td></tr>
</table>
jQuery code:
$("tr:odd")
Result:
[ <tr><td>Value 1</td></tr> ]

Leave a Reply

Your email address will not be published. Required fields are marked *