Esta página foi traduzida do inglês pela comunidade. Saiba mais e junte-se à comunidade MDN Web Docs.

View in English Always switch to English

focusin

Baseline
Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since março de 2017.

O evento focusin é acionado no momento em que o elemento receba o foco. A grande diferença entre esse evento e o evento focus, é que apenas o focusin delega o seu evento para o elemento pai (conhecido como bubbling ou deletegate).

Informações Gerais

Especificação

DOM L3

Interface
FocusEvent
Borbulha

Sim

Cancelável

Não

Alvo

Element

Ação Padrão

Nenhuma.

Propriedades

Property Type Description
target Somente leitura EventTarget Event target losing focus.
type Somente leitura String The type of event.
bubbles Somente leitura Boolean Whether the event normally bubbles or not.
cancelable Somente leitura Boolean Whether the event is cancellable or not.
relatedTarget Somente leitura EventTarget (DOM element) Event target receiving focus.

Especificações

Specification
UI Events
# event-type-focusin

Compatibilidade com navegadores

Eventos Relacionais