Is there an array created somewhere of all the objects with a specific class? I want to find the sixth div with class=”clCategory”. Is there something like:
$('.clCategory:sixth').css(...);
or
$('.clCategory')[6].css(...);
Or do I have to create the array at the same time I programmatically create each of the DIVs with class=”clCategory”?
You’re looking for
eq(x)It’s 0-based, so the 6th would actually be #5
E.g.:
You can also query for
$('.clCategory')and access it at[5]or even.get(5). The difference with either is that you would be getting the DOM HTMLElement, not the jQuery wrapped element as in my previous example.