I can select the first item in the div using
$('.class:first')
Now since I will have random id values, and the class remains the same, I want to access the id of the fourth element, will it be something like this
$('.class:fourth')
using jQuery.
Thanks
Jean
$(‘.class:nth(4)’)UPDATE:
Actually it’s$('.class:nth-child(4)')UPDATE2:
The correct answer is given by @cletus with a great explanation of the differences between
nth-childandeqselector:Please mark his answer as correct.