focus

O evento focus é acionado assim que um elemento recebe um foco. O grande diferencial entre este evento e o evento focusin (en-US), é que esse segundo "borbulha".

Informações Gerais

Especificação

DOM L3

Interface
FocusEvent (en-US)
Borbulha

Não

Cancelável

Não

Alvo

Element

Ação Padrão

Nenhuma.

Nota: Note: The interface was Event prior to Gecko 24. (Firefox bug 855741)

Propriedades

Property Type Description
target Somente leitura EventTarget Event target (DOM element)
type Somente leitura DOMString 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) null

Eventos Delegados

Existem 2 maneiras diferentes de implementações delegados a partir de um evento: por meio da utilização do evento focusin que todos os browsers atuais suportam tão tecnologia (todos exceto o Firefox), ou por setando o parâmetro "useCapture" do elemento addEventListener como true:

(Exemplo de codigo do evento blur (event))

Especificações

Specification
UI Events
# event-type-focus
HTML Standard
# handler-onfocus

Compatibilidade com navegadores

BCD tables only load in the browser

Eventos Relacionais