thelolcat
thelolcat

Reputation: 11625

is $.index() equivalent of nth-child?

is the return value of

$(element).index();

compatible with CSS nth-child(index) ?

I did some tests and it seems it is. Can someone confirm?

Upvotes: 0

Views: 76

Answers (1)

Arun P Johny
Arun P Johny

Reputation: 388406

no... index() is 0 based index, where as nth-child used 1 based index

Demo: Fiddle

Upvotes: 3

Related Questions