Skip to content
masterclass Buddy

Cypress · Method

cy.prev

cy.prev() gets the immediately previous sibling of each current DOM element. An optional selector filters the result.

Last updated

Syntax

.prev() 
.prev(selector) 
.prev(options) 
.prev(selector, options)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • .next()
  • .prevAll()
  • .prevUntil()

Source: cy.prev() | Cypress API Documentation. Checked 2026-11-03.