Skip to content
masterclass Buddy

Cypress · Method

cy.focused

Gets the DOM element that currently has focus. It retries and can be chained with assertions or other commands.

Last updated

Since
0.20.0

Syntax

cy.focused()
cy.focused(options)

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

Subscribe
  • .blur()
  • .focus()
  • cy.press()
  • focus assertion
  • within()

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