Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


:eq css selector should index from zero #652

mattheworiordan opened this Issue · 3 comments

2 participants


I read on about using :eq for traversing and selecting an element using Nokogiri, which is great... untilI discovered that :eq(1) refers to the first element with Nokogiri, and in JQuery it refers to the second element (zero indexed), see As I interchangeably use my CSS selectors in client-side Javascript tests and Capybara tests, this is causing endless issues.

I propose that :eq should be compatible with JQuery and use an zero based index.


Sorry, I should have added this in for reference, I have seen a few mentions online of people experiencing the same surprise.


See for related bug report.

Because this sort of change can break lots of things in bad ways, we're planning on addressing JQuery compatibility in 2.0. You can read more about the roadmap here:

I'll add this issue to the roadmap.


Thanks for the reply, makes sense to make this part of a bigger update as you're right, it could certainly break things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.