I know you can access the first element like this
$(".myClass:first")
But is there a way to do it with an index like in JavaScript .getElementsbyClassname("MyClass").[0]?
Something like:
$(".MyClass:[5]")
:eq: "Because :eq() is a jQuery extension and not part of the CSS specification, queries using :eq() cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method. For better performance in modern browsers, use $("your-pure-css-selector").eq(index) instead."$(".MyClass:nth-child(5)")
nth-child and the eq selector is the nth-child is 1-based whereas eq is 0-based.