Yuck! selects on html elements return zero-based indexing objects while selects on css elements are one-based. I nice bit of inconsistency leading toconfution and many coding errors I bet. Something to watch out for.
Note that :eq(1) selects the second item in the set because JavaScript array numbering is zero-based, meaning that it starts with 0. In contrast, CSS is one-based, so a CSS selector such as $(‘div:nth-child(1)’) would select all div selectors that are the first child of….
Chaffer, Jonathan (2011-09-23). Learning jQuery, Third Edition (p. 34). Packt Publishing. Kindle Edition.






