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.
SubscribeRelated
.blur().focus()cy.press()focus assertionwithin()