--- title: eq comments: true description: '' --- Get a DOM element in an array of elements at the specific index. | | | |--- | --- | | **Returns** | the new DOM element(s) found by the command. | | **Timeout** | `cy.eq` will retry for the duration of the [`defaultCommandTimeout`](https://on.cypress.io/guides/configuration#timeouts) | # [cy.eq( *index* )](#index-usage) Reduce the set of matched DOM elements to the one at the specified index. # [cy.eq( *indexFromEnd* )](#index-from-end-usage) Providing a negative number indicates a position starting from the end of the set, rather than the beginning. # Options Pass in an options object to change the default behavior of `cy.eq`. **cy.eq( *index*, *options* )** **cy.eq( *indexFromEnd*, *options* )** Option | Default | Notes --- | --- | --- `log` | `true` | whether to display command in command log `timeout` | [`defaultCommandTimeout`](https://on.cypress.io/guides/configuration#timeouts) | Total time to retry getting the element # Index Usage ## Find the 2nd element within the elements ```html
When clicking on the `eq` command within the command log, the console outputs the following:
# Related
- [first](https://on.cypress.io/api/first)
- [last](https://on.cypress.io/api/last)